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

OnTouched to OnEntered function?

Asked by 10 years ago

I already tried editing the script by following the wiki tutorial, but the script mess up and so many errors.

X = script.Parent
function onTouched(hit)
script.Parent:FindFirstChild("Humanoid")
script.Parent:FindFirstChild("RedBrick")--Change this to the ingame name of the hat
I = Instance.new("Hat")
I.Parent = hit.Parent
I.AttachmentForward = Vector3.new(-0,-0,-1) --Change this to the AttachmentForward of the hat.
I.AttachmentPos = Vector3.new(0,-2,0.155) --Change this to the AttachmentPos of the hat.
I.AttachmentRight = Vector3.new(1,0,0) --Change this to the AttachmentRight of the hat.
I.AttachmentUp = Vector3.new(0,5,0) --Change this to the AttachmentUp of the that.
I.Name = "RedBrick" --Change this to the ingame name of the hat.
C = script.Parent:clone()
C.Parent = I
C.HatScript:Remove()
end 
script.Parent.Touched:connect(onTouched)

Answer this question