Hello! Hope you are all fine :P Well the problem is that with the (local) script below, is that it works perfectly in studio, but it doesn't work at all in game.. Can anyone help ;-;
Yes its all the script and anyone can copy it but whatever Ooof
local player = game.Players.LocalPlayer local desaa = false local debounce = true local punch = true local ipit = game:GetService("UserInputService") local char = game.Workspace:WaitForChild(player.Name) local arm = char.RightHand local punchanimation = Instance.new("Animation") punchanimation.AnimationId = "http://www.roblox.com/Asset?ID=2837641618" local kickanimation = Instance.new("Animation") kickanimation.AnimationId = "http://www.roblox.com/Asset?ID=2796826423" Instance.new("RemoteEvent",game.ServerScriptService) ipit.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 and desaa == false then local animtype = math.random(1,2) print(animtype) desaa = true debounce = false if animtype == 1 then local fadfa = char.Humanoid:LoadAnimation(punchanimation) arm.Parent = char.RightLowerArm fadfa:Play() end if animtype == 2 then local fadfa = char.Humanoid:LoadAnimation(kickanimation) arm.Parent = char.LeftFoot fadfa:Play() wait(1) fadfa:Stop() end char.Humanoid.WalkSpeed = 0 wait() wait(0.3) debounce = true wait(.9) char.Humanoid.WalkSpeed = 14 debounce = true desaa = false arm.Parent = char end end) arm.Touched:Connect(function(part) local pdafjpas = part.Parent:FindFirstChild("Humanoid",3) if punch == true and debounce == false and part.Parent:FindFirstChild("Humanoid",3)then pdafjpas.Health = pdafjpas.Health - 5 punch = false punch = true arm.Parent = char.RightLowerArm arm.Parent = char end end)
Try changing line 07:
local arm = char.RightHand
to:
local arm = char:WaitForChild("RightHand")
as right arm may not have loaded yet.