Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Why doesnt this script work as a script but it does as a local script?

Asked by 9 days ago
script.Parent.Equipped:connect(function(m)
    m.Button1Down:connect(function()
script.Parent.Parent.Torso.Transparency = 1
    end)
end)

Im trying to have it visible to everyone which can work in a script (maybe im bad at scripting). but it doesnt work in a script. It does work in a local script but I want every player to see it not just yourself

1
:GetMouse() is only client sided if the server attempts to read it, it would result in a error antoniorigo4 99 — 9d

1 answer

Log in to vote
1
Answered by 9 days ago
Edited 9 days ago

You can use the Activated event instead. The Activated event will fire when you click whilst having a tool equipped. It will also work in a server script.

script.Parent.Activated:Connect(function() -- Use 'Connect' instead of 'connect' as 'connect' is deprecated.
    script.Parent.Parent.Torso.Transparency = 1
end)
Ad

Answer this question