First, i have a table on the module script, on the script inside the GUI, i set a MouseButton1Click event on the GUI, after clicking, it will teleport us and insert our name to the table, but something went wrong, i expected it will have 1 player on the table but it got more eventhough i just click it one time
Here's my script:
local join = script.Parent local plrjoin = require(game.ServerStorage.ModuleScript) game.Workspace.Lobby.Floor.Touched:Connect(function(hit) if hit.Parent:FindFirstChild('Humanoid') then join.Visible = true join.MouseButton1Click:Connect(function() local LowerTorso = hit.Parent.LowerTorso LowerTorso.CFrame = game.Workspace.Lobby.SpawnToTeleportPlace.CFrame join.Visible = false end) end end)
Also i cant use the LocalScript because i cant use require() on it
Try this:
local join = script.Parent local plrjoin = require(game.ServerStorage.ModuleScript) game.Workspace.Lobby.Floor.Touched:Connect(function(hit) if hit.Parent:FindFirstChild('Humanoid') then join.Visible = true end end) join.MouseButton1Click:Connect(function() if join.Visible = true then local LowerTorso = hit.Parent.LowerTorso LowerTorso.CFrame = game.Workspace.Lobby.SpawnToTeleportPlace.CFrame join.Visible = false end end)