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

custom physical properties are not changing?

Asked by 5 years ago

code:

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        local pp = PhysicalProperties.new(.1,.3,0.5,1,.2)
        local pc = player.Character
        pc.Head = pp
    end)
end)

when the player is added it is supposed to change the players head physical properties but instead i get the error:

Head is not a valid member of Model

1 answer

Log in to vote
0
Answered by 5 years ago

CharacterAdded passes the players model when they ar spawning so use it to ge the players Head. There also may be a small delay before you can access the Head so use WaitForChild. Lastly you need to assing the new PhysicalProperties to CustomPhysicalProperties .

Example:-


local pp = PhysicalProperties.new(.1,.3,0.5,1,.2) -- it is the same for all players game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) character:WaitForChild("Head").CustomPhysicalProperties = pp end) end)

Hope this helps.

0
thx SodaZere 31 — 5y
Ad

Answer this question