You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want to make my player:LoadCharacter() work.
What is the issue? Include screenshots / videos if possible!
The issue is that, I included a player:LoadCharacter() and it’s not loading me after my function.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I couldn’t find any solutions, but my script isn’t working. It doesn’t load my character.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local groupid = 5
local player = game:GetService("Players").LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
if player:IsInGroup(groupid) then
player.TeamColor = BrickColor.new("Crimson")
player:LoadCharacter()
end
end)
“Load character can only be called by the server backend”
That’s the error you should get when you run that on the client. You can just have a remote that fires to the server.
remote:FireServer()
remote.OnServerEvent:Connect(function(player) --fun fact: the player us always defined, even if you don't define it.
player:LoadCharacter()
end)
local groupid = 32938675
local player = game:GetService("Players").LocalPlayer
local remote = game.ReplicatedStorage.RemoteEvent
script.Parent.MouseButton1Click:Connect(function()
if player:IsInGroup(groupid) then
player.TeamColor = BrickColor.new("Crimson")
remote:FireServer()
end
end)
Made a server script that fires the event
local remote = game.ReplicatedStorage.RemoteEvent
remote.OnServerEvent:Connect(function(player) --fun fact: the player us always defined, even if you don't define it.
player:LoadCharacter()
end)