Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Help please? This script isn't getting the player to jump back up.

This script's supposed to make the target sit, fall down wait 3 seconds, and get up. It does half of that pushes the player down, but the player doesn't get back up. Help please? I think I'm doing this correctly... The output says humanoid isn't a valid member of workspace.

mouse.Target.Parent.Humanoid.PlatformStand = true
mouse.Target.Parent.Humanoid.Sit = true
wait(3)

mouse.Target.Parent.Humanoid.PlatformStand = false
mouse.Target.Parent.Humanoid.Jump = true

Also Another problem is it doesn't debounce anymore?

wait(3)

local User = game.Players.LocalPlayer



local mouse = User:GetMouse()



Animation = Instance.new("Animation")



Animation.AnimationId = "http://www.roblox.com/Asset?ID=199169662"



Animation.Name = "Forcepush"



local animTrack = User.Character.Humanoid:LoadAnimation(Animation)



forceValue = 50 -- The ammount of force to use, for easy changeing






function ForcePush(key)


    if key == "f" then -- Checks if the button is F

        if mouse.Target ~= nil and mouse.Target:IsA("BasePart") then 

            if mouse.Target.Parent:IsA("Hat") then -- If its over a hat

                animTrack:Play() --Plays Anim

                mouse.Target.Parent.Parent.Torso.Velocity = (workspace.CurrentCamera.CoordinateFrame.lookVector*forceValue) + Vector3.new(0,70,0)
                mouse.Target.Parent.Humanoid.PlatformStand = true
                mouse.Target.Parent.Humanoid.Sit = true
                wait(3)
 -- This is the part
mouse.Target.Parent.Humanoid.PlatformStand = false
mouse.Target.Parent.Humanoid.Jump = true
            elseif mouse.Target.Parent:FindFirstChild("Humanoid") then
                 
                animTrack:Play() --Plays Anim
                

                mouse.Target.Parent.Torso.Velocity = (workspace.CurrentCamera.CoordinateFrame.lookVector*forceValue) + Vector3.new(0,70,0)
               
mouse.Target.Parent.Humanoid.PlatformStand = true
mouse.Target.Parent.Humanoid.Sit = true
wait(3)
-- this is the part
mouse.Target.Parent.Humanoid.PlatformStand = false
mouse.Target.Parent.Humanoid.Jump = true
               
                
                script.Disabled = true
                  end
               end
            end
         end

mouse.KeyDown:connect(ForcePush)

1 answer

You have to check if the humanoid is nil first. If your mouse's target is something like 'BasePlate' and you try to index; mouse.Target.Parent.Humanoid, 'Humanoid' isn't a child of Workspace.

2 comments

0

tried that...

0

Well, put it back into your script. Since you got that error.

This discussion is preserved as it was. New answers, comments, and votes are closed.