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

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

Asked by 3 years ago

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

Log in to vote
0
Answered by 3 years ago

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)
0
Geez. does every single thing need to be a call to the server? I was just trying to print() lol Zepptril 0 — 3y
0
It doesn't MiAiHsIs1226 189 — 3y
0
I'm just so confused why it doesn't work. MiAiHsIs1226 189 — 3y
Ad

Answer this question