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

How do i change character properties if they touch this part?

i tried putting this script

humanoid.Touched.Connect(function(hit, head)
	hit.BrickColor = BrickColor.new("Ghost grey")
	hit.Size =  Vector3.new(4,4,4)

	
end
script.Parent.Touched:connect(onTouched)

but it doesnt work, can someone help me? i am still new to scripting so i need some help

1 answer

✓ Accepted answer

You did bit wrong:

2 Connects on One Function

To Connect Use The ":" Instead of "."

What part to touch? (line 1)

To change Propeties, hit.Parent is the Character, Character has the "Head" Child.

Try this script, put it on the part you want thats the player will touch:

In A Basic Script:

local part = script.Parent

part.Touched:Connect(function(hit)
       local hum = hit.Parent:FindFirstChild("Humanoid")
       if (hum~=nil) then
       hit.Parent.Head.BrickColor = BrickColor.new("Ghost grey")
       hit.Parent.Head.Size = Vector3.new(4,4,4)
       end
end)

If it worked, please Give a Soultion!

for More Body Parts, Heres some:

LeftUpperArm, LeftHand, LeftLowerArm: Left Arm

LeftLowerLeg, LeftFoot, LeftUpperLeg: Left Leg

RightUpperArm, RightHand, RightLowerArm: Right Arm

RightLowerLef, RightFoot, RightUpperLeg: Right Leg

2 comments

0

thanks bud

0

No problem!

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