Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

:LoadCharacter() Not working correctly?

Asked by 6 years ago

Now the problem is I cant use :LoadCharacter() in a LocalScript so I would have to call a remote event but then you can't access player from a global script How do I fix???

Here are the scripts:

script 1 (LocalScript)

script.Parent.MouseButton1Click:connect(function(Player)
    game.Players.LocalPlayer.TeamColor = BrickColor.new("Forest green")
    game.Players.LocalPlayer.Character.Humanoid.Health = 0
    game.ReplicatedStorage.Change:FireServer()
end)

Script 2 (GlobalScript)

game.ReplicatedStorage.Change.OnServerEvent:connect(function()
    game.Players.LocalPlayer:LoadCharacter()
end)
0
I've had this problem before. I don't believe load character works in LocalScripts. Skelriq 0 — 6y
0
cant get localplayer in regular scripts oSyM8V3N 429 — 6y

Answer this question