Hello, I am trying to change a character via a local script
Everything is correct, but the character just reloads to my own avatar when I use the command.
Firing Event Script:
local allowedname = "omotashi"
game.Players.PlayerAdded:Connect(function(Player)
Player.Chatted:Connect(function(chat)
if chat =="!Brody" and Player.Name == allowedname then
game.ReplicatedStorage.Brody:FireAllClients()
print("Fired")
else
print("tried")
end
end)
end)
game.ReplicatedStorage.Brody.OnServerEvent:Connect(function(player, newBaby)
player:LoadCharacter(newBaby)
end)
Local Usage Script:
game.ReplicatedStorage.Brody.OnClientEvent:Connect(function()
local BrodyF = game.ReplicatedStorage:FindFirstChild("BrodyDude")
local player = game.Players.LocalPlayer
local oldchara = player.Character
local customchara = BrodyF:Clone()
customchara.Name = player.Name
player.Character = customchara
customchara.HumanoidRootPart.CFrame = workspace.SpawnLocation.CFrame + Vector3.new(0,3,0)
end)
Here is also a video on the character and what happens when you use the command