Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Making an arrow that will go up and down, but it's delayed when I'm trying to move it?

Asked by 3 years ago

Hey!

So I have this local script, located at StarterCharacterScripts and everytime the players steps on a part (the part has a separate script inserted that will give the player money), it gives them some money. After stepping, there is like a small delay before the arrow moves.

I've no idea how to fix this, or why is it delayed as I'm new to programming.

Any help is appreciated!

If I didn't explain this well enough, let me know!

Player = game.Players.LocalPlayer
Money = Player.leaderstats.Money
Arrow = game.Workspace.Arrow
WaitTime = 0.05


while wait() do

    if Money.Value == 0 then
        Arrow.CFrame = CFrame.new(Vector3.new(-13.5, 5.249, 16))
        Arrow.Rotation = Vector3.new(0, 90, 90)

        repeat
            for I=1,5 do 
                Arrow.CFrame = Arrow.CFrame+Vector3.new(0,0.1,0) 
                wait(WaitTime)
            end
            for I=1,5 do 
                Arrow.CFrame = Arrow.CFrame+Vector3.new(0,-0.1,0) 
                wait(WaitTime)
            end

        until Money.Value == 1

    end

end
0
how big is the delay? is it more than a second? 123jangamer321 28 — 3y
0
About a second, yeah. SonGohan6 85 — 3y

Answer this question