Help with remote events

so I have been trying to create a lobby system sort of like the one in the mimic but I ran into an issue while trying to make the base for the create party.

here is my server code

local remoteevents = game.ReplicatedStorage.RemoteEvents
local parties = game.ReplicatedStorage.Parties


remoteevents.Create.OnServerEvent:Connect(function(data)
	local folder = Instance.new("Folder")
	local joincode = Instance.new("IntValue")
	joincode.Value = data.join_code
	joincode.Name = "PartyCode"
	folder.Name = data.namecode
	folder.Parent = parties
end)


here is my local script code:

local textbox = script.Parent.Parent.TextBox

local this = script.Parent
script.Parent.MouseButton1Click:Connect(function()
	local Datatable = {
		join_code = math.random(1, 9999);
		namecode = string.lower(textbox.Text)
	}
	game.ReplicatedStorage.RemoteEvents.Create:FireServer(Datatable)
end)


I have datatable because before I was getting attempted to setname expected string got instance.
now in the output I get joincode is not a valid member of stormmaster9090

does anyone know how to fix this?

The first parameter to an OnServerEvent callback will always be the player that fired the event. This is done automatically.

1 Like

thank you very much!
I feel so dumb that i didnt know that

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.