Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local part = script.Parent
- local l = game.Lighting
- local function onPartTouched(otherPart)
- -- Get the other part's parent
- local partParent = otherPart.Parent
- -- Look for a humanoid in the parent
- local humanoid = partParent:FindFirstChildWhichIsA("Humanoid")
- if humanoid then
- if l.NormalCC then
- l.NormalCC:Destroy()
- end
- if l.SunRays then
- l.SunRays:Destroy()
- end
- local waterThing1 = l.WaterPP.WaterCC:Copy()
- local waterThing2 = l.WaterPP.WaterDOF:Copy()
- waterThing2.Parent = l
- waterThing1.Parent = l
- end
- end
- local function onPartTouchEnded(otherPart)
- if l.WaterDOF then
- l.WaterDOF:Destroy()
- end
- if l.WaterPP then
- l.WaterPP:Destroy()
- end
- local normalThing1 = l.NormalPP.SunRays
- local normalThing2 = l.NormalPP.NormalCC
- normalThing1.Parent = l
- normalThing2.Parent = l
- end
- part.TouchEnded:Connect(onPartTouchEnded)
- part.Touched:Connect(onPartTouched)
Add Comment
Please, Sign In to add comment