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

Snowball spell not summoning a snowball when used once, as well of the snowball falling (?)

Asked by 2 years ago

I am making a tool that summons a snowball that moves In a straight line, which grows every 0.1 second (In roblox time) anyway It somewhat works, when I use the tool once It works just the snowball falls down, but when I used It again It won't let me summon a snowball

Script:

01local tool = script.Parent
02local Debounce = false
03 
04tool.Activated:Connect(function()
05    if Debounce == false then
06        Debounce = true
07        tool.Explosion:Play()
08        print("Snowball use uh turn people Into snowman or whatever, yeah")
09        local SnowBall = Instance.new("Part")
10        local VectorForce = Instance.new("VectorForce")
11        local Attachment = Instance.new("Attachment")
12        local ParticleEffect = Instance.new("ParticleEmitter")
13        SnowBall.Parent = game.Workspace
14        SnowBall.Position = tool.Parent.Torso.Position
15        SnowBall.Orientation = tool.Parent.Torso.Orientation
View all 40 lines...

1 answer

Log in to vote
1
Answered by 2 years ago

Hello!,

On line 33, you have entered a while loop, but it wont get out of the while loop until loop is broken, try something like

01local tool = script.Parent
02local Debounce = false
03 
04tool.Activated:Connect(function()
05    if Debounce == false then
06        Debounce = true
07        tool.Explosion:Play()
08        print("Snowball use uh turn people Into snowman or whatever, yeah")
09        local SnowBall = Instance.new("Part")
10        local VectorForce = Instance.new("VectorForce")
11        local Attachment = Instance.new("Attachment")
12        local ParticleEffect = Instance.new("ParticleEmitter")
13        SnowBall.Parent = game.Workspace
14        SnowBall.Position = tool.Parent.Torso.Position
15        SnowBall.Orientation = tool.Parent.Torso.Orientation
View all 39 lines...
0
Hello! Thank you! It works but the snowball will keep falling even I want It to be floating moving In a straight line but I'll accept It! imnotaguest1121 362 — 2y
Ad

Answer this question