what I'm currently using only works in studio, is there any way you can get it to work in roblox player?
local player = game.Players.LocalPlayer
local handle = player.Character.Torso
what I'm currently using only works in studio, is there any way you can get it to work in roblox player?
local player = game.Players.LocalPlayer
local handle = player.Character.Torso
It doesn't work on game because you are trying to call the players torso before it loads into the game. In the studio it loads before the scripts. But in a real game the character takes longer to load. I suggest using this:
repeat wait() until player.Character
to make the script wait until the character has loaded in
this would pan out to
local player = game.Players.LocalPlayer
repeat wait() until player.Character
local handle = player.Character.Torso
if that doesnt work do
local handle = player.Character:WaitForChild("Torso")
game.Players.LocalPlayer.Character.Torso
that's mostly it
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
What type of script are you using? LocalScript or Script? A code like this should be handled in a Local Script.