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

Why is it not changing the HeadScale Property?

Changed it to a server script and into the serverscriptservice. I don't know what's going on with this but It says: "Humanoid is not a valid member of Player"

local Players = game:GetService("Players")
local Player = game.Players.LocalPlayer
local character = game.Players.LocalPlayer.Character
function Bruh(value, Wait)
	wait(Wait)
	game.Players.LocalPlayer.Humanoid.HeadScale.Value = (value)
	end
wait(.1)
Player.CharacterAdded:Connect(Bruh(3, 3))

2 comments

0

Help

0

You like scp?

1 answer

✓ Accepted answer

OK, this is a pretty common error among people starting out scripting. It's pretty easy to fix and get used to tho.

You are referring to the Player object while using game.Players.LocalPlayer this is the object that holds information such as Name, UserID, Account Age, etc. What you need is the Character. This is an object within workspace that holds all the contents of the player's avatar. It also holds things like Humanoid, Body Parts, Animation, etc.

Here is how you would reference the Character form the player:

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

-- That is the simplest way to refer to the character. From there you can do things like this:

print(character.Humanoid.Health)

Also, you're trying to call CharacterAdded from a LocalScript which will not run. You'll need to do this from a ServerScript.

2 comments

0

So all I have to do is change the script to a server script, put it in server script storage, change local character to what you told me, then change game.Players.LocalPlayer.Humanoid.HeadScale.Value to character.Humanoid.HeadScale.Value

0

Well if you're going to do that, don't use Game.Players.LocalPlayer. Use game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) local humanoid = character:WaitForChild("Humanoid") end) and add that to ServerScriptService.

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