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

Handle-less tool not working in Studio Run or Play mode?

I've made a tool in StarterPack, unticked RequiresHandle, unticked CanBeDropped then I made a child script / non-local Script.

script.Parent.Activated:Connect(function() print("It Works") end)

nothing happens when it is activated but it does get a blue square around it. The blue square goes away when it is clicked again. It never prints the message to the console.

most of the examples I see use named functions.

so I'll try

tool = script.Parent

local function doThis() print("It Works") end

tool.Activated:Connect(doThis)

and I have the same problem. I've tested both of these as a localscript and a script.

1 answer

Yeah, had this problem. You can use remotes

--LocalScript
script.Parent.Equipped:Connect(function(mouse)
mouse.Button1Down:Connect(function()
Remote:FireServer() 
end)

--

-- Server Script
script.Parent.Equipped:Connect(function()
Player = script:FindFirstAncestorOfClass("Player")
end)
Remote.OnServerEvent:Connect(function(plr)
if plr ~= Player then
return -- It's an exploiter
end
-- Your script

end)

3 comments

0

Geez. does every single thing need to be a call to the server? I was just trying to print() lol

0

It doesn't

0

I'm just so confused why it doesn't work.

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