Hi, I want to morph a player to a character in my slap battles fanmade game, i did it but. Then when i try to use other ability it dosent work.
Main ability handler (The part):
elseif equipped.Value == 51 then
local char = player.Character
local cChar = player.Character:Clone()
local newchar = game.ServerStorage.rob:Clone()
newchar.HumanoidRootPart.Anchored = false
newchar:SetPrimaryPartCFrame(char.PrimaryPart.CFrame)
local Glove = char:FindFirstChildOfClass("Tool")
Glove.Parent = newchar
player.Character = newchar
newchar.Parent = workspace
task.wait(10)
cChar.HumanoidRootPart.Anchored = false
cChar:SetPrimaryPartCFrame(newchar.PrimaryPart.CFrame)
Glove.Parent = cChar
player.Character = cChar
cChar.Parent = workspace
end
Here is how an ability works:
if equipped.Value == 1 then
local Fart = game.ServerStorage:WaitForChild("Fart")
local ClonedFart = Fart:Clone()
ClonedFart.Parent = char.HumanoidRootPart
ClonedFart:Play()
Hum.WalkSpeed = 32
wait(2.5)
ClonedFart:Destroy()
Hum.WalkSpeed = 16
Here is the client-side script:
elseif equipped.Value == 51 and game.Players.LocalPlayer.Character:FindFirstChildOfClass("Tool"):FindFirstChild(equipped.Value) then
local cooldown = 30
local originalCooldown = 30
local label = game.Players.LocalPlayer.PlayerGui:WaitForChild("AbilitryGui").TextButton.CooldownLabel
label.Parent.Visible = true
label.Parent.LocalScript.Disabled = true
event:FireServer(equipped)
script.Disabled = true
while wait(0.1) do
cooldown = cooldown - 0.1
label.Size = UDim2.new(cooldown / originalCooldown, 0,1,0)
if cooldown <= 0 then
if player.Character:FindFirstChild("Humanoid") and player.Character:FindFirstChild("Humanoid").Health > 0 then
label.Size = UDim2.new(0,0,1,0)
label.Parent.Visible = false
break
else
break
end
elseif player.Character:FindFirstChild("Humanoid") and player.Character:FindFirstChild("Humanoid").Health <= 0 then
label.Size = UDim2.new(0,0,1,0)
label.Parent.Visible = false
break
end
end
script.Disabled =false
(The abilitry part is typed good)
So Basically when u press E you morph and it does it all correct. BUT then when i try to activate it a second time and i press E nothing happens. Please help. Just pressing E 1 time u cannot use ANY ability form any glove.