Im making a dungeon game on roblox, and i don't know how to arrange remote events with client events in the GUI Could anyone help?

server [local placeId = 123 local leaderUserId = 1

local partyPlayersList = { game:GetService('Players').Player1, game:GetService('Players').Player2 }

game:GetService('ReplicatedStorage').TeleportSquad.OnServerEvent:Connect(function(player) -- Connects a function to execute when the "TeleportSquad" event is fired

if player.UserId == leaderUserId then -- Checks if the player who clicked the start button is equal to the party leader game:GetService('TeleportService'):TeleportPartyAsync(placeId, partyPlayersList) -- Teleports all players in "partyPlayersList end

end)`] (http://)

server

[`local Parties = {}

game:GetService('ReplicatedStorage').CreateSquad.OnServerEvent:Connect(function(player)

if not Parties[player.UserId] then -- Check if the player has already created a party by attempting to index it in the "Parties" table Parties[player.UserId] = { -- Create the party data Players = {} } end

end)] (http://)

client

StartButton.MouseButton1Click:Connect(function() -- Connects a function to execute when the client clicks the button game:GetService('ReplicatedStorage').TeleportSquad:FireServer() -- Fires the remote event end) Client

[[CreateSquadButton.MouseButton1Click:Connect(function() game:GetService('ReplicatedStorage').CreateSquad:FireServer() end)]] (http://)

2 comments

0

Please edit the post and format your post, there is a LUA button that puts out characters that you place your code in. It will make your code much easier to read and more likely for your question to be answered.

0

whenever i highlight the code, and select lua then press save edits, the edits dont work. i cant seem to work it out.