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

Why is it not changing the HeadScale Property?

Asked by 5 years ago
Edited 5 years ago

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))
0
Help barfpillow99 28 — 5y
0
You like scp? barfpillow99 28 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

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.

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 barfpillow99 28 — 5y
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. namespace25 594 — 5y
Ad

Answer this question