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

Why when I call the function when the tool is activated it won’t work?

Asked by 3 years ago

My friend made a small script that is made to ( I’m surprised i doesn’t work) make a part in the Workspace with Instance.new when the tool is activated, he says it doesn’t work. It could also be a problem with calling the function or the tool variable he made. Why is it broken and not working? Thank you very much in advance, the solution is probably something simple. I’ll also be putting to script below. Thanks again.

local tool = script.Parent

function newPart() local part = Instance.new("Part") part.BrickColor = BrickColor.new("Lapis") part.Transparency = 0.6 part.Parent = game.Workspace part.Position = Vector3.new(0, 100, 0) end

If tool.Activated then newPart() end

0
And I thought this was so simple. Roblox28721 10 — 3y
0
Instead of a if statement, try tool.Activated:Connect(newPart). It is a event where everytime a tool activate, a function will run AProgrammR 398 — 3y

Answer this question