--client
local RS = game:GetService("ReplicatedStorage")
local T = RS:WaitForChild("Test")
script.Parent.MouseButton1Up:Connect(function()
T:FireServer()
end)
--Server
local RS = game:GetService("ReplicatedStorage")
local T = RS:WaitForChild("Test")
local function SetChar(Player)
local NewAnimate = Player.Character.Animate:Clone()
local NewClone = RS:WaitForChild("Civilan"):Clone()
NewClone.Name = Player.Name
Player.Character = NewClone
NewClone.HumanoidRootPart.CFrame = game.Workspace:WaitForChild("SpawnLocation").CFrame + Vector3.new(0,3,0)
NewClone.Parent = game.Workspace
end
T.OnServerEvent:Connect(function(Player)
SetChar(Player)
Player.CharacterAdded:Connect(function(char)
SetChar(Player)
end)
end)
Thanks this works but the only thing is I get these errors
13:04:41.590 Maximum event re-entrancy depth (80) exceeded for Instance.ChildRemoved - Studio
13:04:41.590 Maximum event re-entrancy depth (80) exceeded for Instance.ChildAdded - Studio
13:04:41.590 Maximum event re-entrancy depth (80) exceeded for Player.CharacterAdded - Studio