Hello! I have a glitch effect and I want it to show to the player who is touching it and only show when your in the part. How would I make this work?
LocalScript 1
script.Parent.Touched:Connect(function()
local Glitch = script.Parent.GlitchEffect:Clone()
Glitch.Parent = game.Players.LocalPlayer
Glitch.Enabled = true
end)
LocalScript 2
while wait(0.1) do
if script.Parent.Enabled == true then
script.Parent.Glitch:Play()
script.Parent.ImageLabel.Visible = true
wait(5)
script.Parent.Enabled = false
elseif script.Parent.Enabled == false then
script.Parent.Glitch:Stop()
script.Parent.ImageLabel.Visible = false
end
end