Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

this is easy script but idk why it wont work it's a script in side a tool ,how do i fix?

local di = true
script.Parent.Activated:Connect(function()
	 while di == true do
		wait()
		script.Parent.RightHand.ParticleEmitter.Rate = script.Parent.RightHand.ParticleEmitter.Rate + .12

	end
		local p = Instance.new("Part",game.Workspace)
		local x = Instance.new("BodyVelocity",p)
	
	
end

4 comments

0

its not disabled

0

What error are you getting? You might need to put a closing parenthesis after the last end statement.

0

theres a parenthesis for the last end

0

the parent parameter of Instance.new() is decaperated, instead set the parent lasr

1 answer

Alright, here's the modified code. Not sure if this is the answer, but here it is.

local di = true
script.Parent.Activated:Connect(function ()
     while di == true do
	wait()
        script.Parent.RightHand.ParticleEmitter.Rate = script.Parent.RightHand.ParticleEmitter.Rate + .12

    end
	local p = Instance.new("Part")
	p.Parent = game.Workspace
	local x = Instance.new("BodyVelocity",p)
end)

Here's some things in mind. The way you used the Instance.new() constructor function is deprecated. It's better to parent it after the creation. (or later) A right parentheses ) was forgotten at line 11, column 4, since you didn't create the callback function earlier (but that works!)

This discussion is preserved as it was. New answers, comments, and votes are closed.