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

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

Asked by 4 years ago

i tried putting this script

1humanoid.Touched.Connect(function(hit, head)
2    hit.BrickColor = BrickColor.new("Ghost grey")
3    hit.Size =  Vector3.new(4,4,4)
4 
5 
6end
7script.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

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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:

1local part = script.Parent
2 
3part.Touched:Connect(function(hit)
4       local hum = hit.Parent:FindFirstChild("Humanoid")
5       if (hum~=nil) then
6       hit.Parent.Head.BrickColor = BrickColor.new("Ghost grey")
7       hit.Parent.Head.Size = Vector3.new(4,4,4)
8       end
9end)

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

0
thanks bud skeletonpiratejack 13 — 4y
0
No problem! RektwayYTB 123 — 4y
Ad

Answer this question