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

custom physical properties are not changing?

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

✓ Accepted answer

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.

1 comment

0

thx

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