Roblox:我怎么做才能使此脚本正常工作?

问题描述

我目前正在为游戏编写脚本,但是有一个问题。我的脚本无法正确执行,只是将边缘置于地图之外!如果有人可以调试它,那就太好了。 Scripting Helpers Link

SELECT

解决方法

有几个错误,例如,您必须使用goal作为对象而不是向量,向量将是goal.Position,在调用它时也必须只是目标no {Size =目标},您不需要每次都创建相同的所有信息,我没有得到您想要达到的目标,但是我想让它向上移动,所以将是这样的:>

local TS = game:GetService("TweenService")
local RS = game:GetService("RunService")
local HS = game:GetService("HttpService")

local part = script.Parent.SpawnTherm:WaitForChild("Moving")
local start = {}
start.Position = script.Parent.Position --where you want the part to start moving
local goal = {}
local tweenInfo = TweenInfo.new(
    4,Enum.EasingStyle.Cubic,Enum.EasingDirection.Out,false,0
)

while wait(4) do
    script.Parent.Position = start.Position
    local mathRandom = math.random(2.5,4) --your value,I used 15 to test it
    goal.Position = Vector3.new(0.7,mathRandom,0.05)
    local Tween = TS:Create(part,tweenInfo,goal)
    Tween:Play()
end

我使它在这里起作用: https://www.roblox.com/games/5842432488/Help-for-reidlab

您可以编辑地点