First Image, the code that closes an gui after pressing an button.
Image of the code that awards people the tool, which happens when an player joins the server.
I’ve mentioned before that i’m pretty much an beginner with coding, so help is appreciated.
if im right, you want to give a tool with a click of a button (with GUI of course):
roblox has this instance called RemoteEvent, it will send a server signal to the client (player) and vice versa.
so, first make a Remote instance and place where you want, then to the local script, make this:
script.Parent.MouseButton1Click:Connect(function()
RemoteEvent:FireServer()
end)
And this on the server script
RemoteEvent.onServerEvent:Connect(function(player)--the player is set by default, just write it in the brackets
tool.Parent = player.BackPack
end)
Yes, I own an roleplay game and there’s an area with an world map, where members of the group get an paint bucket, and once they leave said map using an tp gui, the tool gets taken away from their invertory.
Edit: I’m still clueless with how this works, but i now have an remoteEvent in said gui.
I still don’t really get what to do next, but if i can just paste the code you’ve written in the “PlayButton” script, then that would probably help.
With the help of chatGPT, i managed to get the tool giving to work, now i just have to make sure the tool gets taken away once, any assistance?
Edit: I figured it out, but thanks for the help, GabrielG!