Why does my script work fine in studio, but does not work at all in the actual game?
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
01 | local player = game.Players.LocalPlayer |
05 | local ipit = game:GetService( "UserInputService" ) |
06 | local char = game.Workspace:WaitForChild(player.Name) |
07 | local arm = char.RightHand |
10 | local punchanimation = Instance.new( "Animation" ) |
13 | local kickanimation = Instance.new( "Animation" ) |
16 | Instance.new( "RemoteEvent" ,game.ServerScriptService) |
20 | ipit.InputBegan:Connect( function (input) |
22 | if input.UserInputType = = Enum.UserInputType.MouseButton 1 and desaa = = false then |
23 | local animtype = math.random( 1 , 2 ) |
29 | local fadfa = char.Humanoid:LoadAnimation(punchanimation) |
30 | arm.Parent = char.RightLowerArm |
34 | local fadfa = char.Humanoid:LoadAnimation(kickanimation) |
35 | arm.Parent = char.LeftFoot |
40 | char.Humanoid.WalkSpeed = 0 |
45 | char.Humanoid.WalkSpeed = 14 |
60 | arm.Touched:Connect( function (part) |
61 | local pdafjpas = part.Parent:FindFirstChild( "Humanoid" , 3 ) |
62 | if punch = = true and debounce = = false and part.Parent:FindFirstChild( "Humanoid" , 3 ) then |
63 | pdafjpas.Health = pdafjpas.Health - 5 |
66 | arm.Parent = char.RightLowerArm |