I’m making a throwable item and I set the velocity to be 200. But for some reason instead of 1 lemon there four thrown.
I don’t really know what to do. The only thing the script does is copy the lemon and give it velocity.
Link to gif if it doesn’t load: http://elperson.is-a-good-scripter.xyz/bdrjb.gif
2 Likes
Could you provide your code? I cannot help you unless you show me.
1 Like
tool.Activated:Connect(function()
local LoadedAnim = Plr.Humanoid:LoadAnimation(ThrowAnim)
LoadedAnim:Play()
local LemonClone = ServerStorage.ExplodingLemon:Clone()
LemonClone.CFrame = Plr.Torso.CFrame * CFrame.new(0,0,-4)
LemonClone.Velocity = Plr.Torso.CFrame.LookVector * 200
LemonClone.Parent = game.Workspace
print("ACTIV")
end)
here
2 Likes
Look in the output. Whenever you activate the tool, does it say ACTIV 4 times?
1 Like
Try adding a
wait(.1)
After the print statement
2 Likes
I am not an expert in coding but try adding a cooldown whenever the user activates the tool. Other than that the code seems fine.
1 Like
Yeah exactly! A cooldown!
1 Like
Yes it says activ 4 times. 20charrssss
Alright then try making a cooldown as we said. After the print command do,
wait(0.1)
That way it should be fixed.
1 Like
You’re right but actually 0.7 fixes the issue. Anyways Thanks for help!
2 Likes