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

?Scripts in local objects seem to not work

So there's a box, a button that resets the box, a door and a button that opens that door. Everything works perfectly in normal conditions but I need these objects to be local in order to prevent chaos with multiple people. The problem is that when I tested, scripts inside those local objects stop working. Neither of the buttons work. I tried changing the regular script to a local one but nothing changed. I have no idea what to do...

Since it was asked I will also include this: (it works but only when created by the server)

script.Parent.ClickDetector.MouseClick:Connect(function()
	
	script.Parent.Texture.Color3 = script.Parent.charged.Value
	script.Parent.platform.Value.Texture.Color3 = script.Parent.charged.Value

	wait(.2)

	script.Parent.Texture.Color3 = script.Parent.off.Value
	script.Parent.platform.Value.Texture.Color3 = script.Parent.off.Value

	script.Parent.cube.Value.CFrame = script.Parent.platform.Value.CFrame + Vector3.new(0,6,0)

end)

3 comments

0

Show us your script.

0

It's not a script thing it's the execution. As I said, it works perfectly when the objects are created on server and not on client.

0

You can't use LocalScripts inside objects that are not on the client, parent the LocalScript to the client and change the code to fit your uses

1 answer

There are things only visible in the client. and there ar ethings visible among everything. To make a script what only works in the client, do it in a localscript! You can connect a local script to a normal one by using remoteevents. Hope i was able to help!

1 comment

0

I already knew this, and I already tried using local scripts, the problem is that the buttons and doors are individual to each player. You did give me some ideas of how to deal with it so I will say thank you. :?

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