I was tried to make UI play button for my menu. I added script (Local script) , but there is error in my script about LoadCharacter() - Players.Egor_Naum.PlayerGui.ChooseTeamGui.Play.PlayTextButton.ClickScript:6: attempt to index nil with 'LoadCharacter' . I tested ALMOST all stuff. How to fix?
script.Parent.MouseButton1Click:Connect(function(plr)
if game.Players.LocalPlayer.TeamColor ~= BrickColor.new("Medium stone grey") then -- check if player choosed team (if (s)he not choosing team)
game.Lighting.Blur.Size = 0 -- Makes blut size to 0
plr:LoadCharacter(plr) --Refresh character
script.Parent.Parent.Parent.Enabled = false -- Makes GUI not enabled
script.Parent.Parent.Parent.MenuMusic:Stop() -- Stops music
game.Workspace.Camera.CameraType = Enum.CameraType.Custom -- Makes default (custom) camera
print(game.StarterGui.ChooseTeamGui.ChooseTeam.Frame.Visible )
--If player dont choosed team (if (s)he choosign team --
else
script.Parent.Parent.ChooseTeamWarning.TextTransparency = 0-- Makes warning text visible
wait(1)
script.Parent.Parent.ChooseTeamWarning.TextTransparency = 1-- Makes warning text invisible
end
end)

2 comments
It says " LoadCharacter can only be called by the backend server "
Thanks! It worked.