Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I know this is prob a dumb question but why am i getting this error?

Asked by
abrobot 44
6 years ago
Edited 6 years ago

Torso is not a valid member of Script

wait(5)
if game.Workspace.Abrobot.Torso.Velocity.magnitude > 0 then 
    print(324) end

0
First do :FindFirstChild("Torso"). KenUSM 53 — 6y
0
i will try abrobot 44 — 6y
0
it did not work maybe i don't understand what you mean sorry i new at the scripting things abrobot 44 — 6y
0
If your name isn't Capitalized in game then don't Capitalize it in the script, all Coding is Caps Sensitive. Try game.Workspace:WaitForChild("abrobot").Torso.Velocity.magnitude KenUSM 53 — 6y
View all comments (11 more)
0
Infinite yield possible on 'Workspace:WaitForChild("abrobot")' abrobot 44 — 6y
0
try local abrobot = game.Workspace:WaitForChild("abrobot"), if abrobot.Torso.Velocity.magnitude > 0 then print(324) else print("Velocity.magnitude Is not greater than 0") end KenUSM 53 — 6y
0
oh do you know why there is a -5 by my name abrobot 44 — 6y
0
thx for all your help im just starting to try to script and im not that good i appreciate your help abrobot 44 — 6y
0
oh it did not work abrobot 44 — 6y
0
Np, It's in the negatives if someone down votes your thread or answer, it takes away a certain amount of points even if you started with 0. KenUSM 53 — 6y
0
Can you show more of the script because i can't really help any more than that if i can't see what might be interfering. KenUSM 53 — 6y
0
thats it thats all the script abrobot 44 — 6y
0
see im trying to test something and i want my guy to be anchored when his velocity is at 0 after he jumps abrobot 44 — 6y
0
Well to do that it's a lot more complex, Velocity won't detect if Player is jumping. You would need to use UserInputService and you would need to learn a lot more Roblox Lua to be decent at at least trying to figure out how to do it. Later today i can try to help you. KenUSM 53 — 6y
0
kenUSM thx for your help and im getting off now but i will be on tomorrow and i sent you a friend request on roblox but itis still Infinite yield possible on 'Players:WaitForChild("abrobot")' abrobot 44 — 6y

1 answer

Log in to vote
0
Answered by
Trewier 146
6 years ago
Edited 6 years ago

Not sure what you're trying to accomplish here, if your character is R6 then torso should work, if it is R15 though you're going to want to search for "UpperTorso" or "LowerTorso"


--Lets grab the players from the game players = game:GetService("Players") --Wait for abrobot in the game's players player = players:WaitForChild("abrobot") --Grab the players character from the player character = player.Character --Grab the torso from the character torso = character:FindFirstChild("Torso") --Check velocity and print if its above 0 if torso.Velocity.magnitude > 0 then print(324) end
0
um im trying to test something and im using r6 abrobot 44 — 6y
0
Oops, put it all in a block quote on accident, you should be able to copy what I provided and it should print out when needed Trewier 146 — 6y
0
still Infinite yield possible on 'Players:WaitForChild("abrobot")' abrobot 44 — 6y
0
Depends on where you are testing it at, try changing abrobot to Player1, if you arent logged in on Studio it will default to Player1 as the player name Trewier 146 — 6y
View all comments (3 more)
0
Use your Roblox Name exactly how it is. If it is Abrobot or abrobot. If you don't it won't detect it and it will throw that error. KenUSM 53 — 6y
0
i really appreciate you guys helping me out abrobot 44 — 6y
0
If my answer was what you needed, accept it so the question appears answered any nobody else posts one Trewier 146 — 6y
Ad

Answer this question