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

2 comments

0

how big is the delay? is it more than a second?

0

About a second, yeah.