Im trying to make a script where it finds yourplayer then sits you down. But its not working in studio. This script is a localscript
player_name=game.Players.LocalPlayer.Name character=workspace:findFirstChild(player_name) while true do character.Humanoid.Sit = true wait(0.5) end
Local Script
repeat wait() until game.Players.LocalPlayer.Character while true do game.Players.LocalPlayer.Character.Humanoid.Sit = true wait(.5) end
Well, we don't need the player name for this example. So we can rule that out. We can also create a short reference to the character by indexing LocalPlayer with "Character".
Here, try this:
-- Get the local player (should be in a local script) local Client = game:GetService'Players'.LocalPlayer -- just in case the character needs time to load local Character = Client.Character or Client.CharacterAdded:wait() while true do local Human = Character:FindFirstChild'Humanoid' if Human then Human.Sit = true end wait(0.5) end
Let me know if you have any questions.