You are on page 1of 2

Ok so here are the scripts the scripts will be highlighted in blue

Changelocal:

local changeEvent = game.ReplicatedStorage:WaitForChild("ChangePlayerCharacter")

local characterValue = script.Parent:WaitForChild("CharacterName")

local isCool = false


local coolTime = 1

script.Parent.MouseButton1Click:Connect(function(player)
if isCool == false then
isCool = true
local charactername = characterValue.Value
changeEvent:FireServer(charactername)
end
end)

changeEvent.OnClientEvent:Connect(function()
wait(coolTime)
isCool = false
end)
___________________________________________________________________________
Other script youll see in the vid:

local changeEvent = game.ReplicatedStorage:WaitForChild("ChangePlayerCharacter")

local charsFolder = game.ReplicatedStorage:WaitForChild("Characters")

changeEvent.OnServerEvent:Connect(function(player,chosenCharacter)
if charsFolder:FindFirstChild(chosenCharacter) then
local newChar = charsFolder:FindFirstChild(chosenCharacter):Clone()
local plrChar = player.Character

if newChar:FindFirstChild("HumanoidRootPart") then
newChar.PrimaryPart = newChar.HumanoidRootPart
newChar:SetPrimaryPartCFrame(plrChar.HumanoidRootPart.CFrame)
elseif newChar:FindFirstChild("Torso") and not
newChar:FindFirstChild("HumanoidRootPart") then
newChar.PrimaryPart = newChar.Torso
newChar:SetPrimaryPartCFrame(plrChar.Torso.CFrame)
end
if player.Character:FindFirstChild("Animate") then
local anim = player.Character:FindFirstChild("Animate"):Clone()
anim.Parent = newChar
end

newChar.Name = player.Name
player.Character = newChar

local rootPart = newChar:FindFirstChild("HumanoidRootPart") or


newChar:FindFirstChild("Torso")
local plrRoot = player.Character:FindFirstChild("HumanoidRootPart") or
player.Character:FindFirstChild("Torso")

if rootPart and plrRoot then


rootPart.CFrame = plrRoot.CFrame
end

newChar.Parent = workspace
else
warn("character doesnt exist or something went wrong.")
end
end)________________________________________________________________________
__

You might also like