Hello. I am creating team-change gui and i want to do quick respawn. The rest of script is working correctly only player:LoadCharacter() is not working.

local color = "Sand green"
local group = 4384871
local player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:Connect(function()
	if player:IsInGroup(group) then
	player.TeamColor = BrickColor.new(color)
	player:LoadCharacter()
	script.Parent.Parent.Parent.Visible = false
	end
	end)

5 comments

0

You're calling this from a GUI, so I imagine you're trying to do this all locally? You need to handle this all on the server. LoadCharacter, specifically, won't work from the client as well.

0

so how i can do that with button?

0

thank you

0

No problem. If you have issues understanding remotes, feel free to ask in the Site Chat or the Discord. They can be a bit daunting. Good luck.