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

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

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 comment

1

:GetMouse() is only client sided if the server attempts to read it, it would result in a error

1 answer

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)

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