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

How can i make this Client To Server FE script work?

I have to script thats Client to Server. This script works in Studio but not in game. I don't know what i'm doing wrong. Can anyone help? Thanks.

Server Script

game.ReplicatedStorage.DoDun.OnServerEvent:Connect(function(Player,Button)
	Button:Destroy()
end)

Local Script

local Button = script.Parent

script.Parent.MouseButton1Down:Connect(function()
	game.ReplicatedStorage.DoDun:FireServer(Button)
end)

1 answer

The thing is, you're firing the server, but you're still trying to complete a local task. Destroying a button GUI is something that can be done in one local script, but you're trying to bring the server into this.

local Button = script.Parent

Button.MouseButton1Down:Connect(function()
	Button:Destroy()
end)

This script is all you need to destroy a button, you don't need to use remote events or server scripts to access the server since the button is only on the player's screen.

However, I still have a challenge for you...

How about making it so when you press a button a part is created in the server? Pressing a button is something local, and creating a part is something on the server, so you see that you have to use a Remote Event for that.

Show me your script when you're done and if you need any help with it! :D

2 comments

0

Would something like welding be done in server side or local side?

0

want it to be on the server; take a guess

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