I have a part with click detector thats when clicked, it goes up to the player the playerscripts and finally setting the value of disable to false, when I did it on the first try it gave me an error so i put :WaitForChild() for the player scripts, but its giving me this error Infinite yield possible on 'Players.ninjanerd601:WaitForChild("PlayerScripts")
the script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("PickupItem")
local click = script.Parent.ClickDetector
local text = script.Parent.MouseoverText.Value
click.MouseClick:Connect(function(click)
click:WaitForChild("PlayerScripts").Flashlight.Disabled = false --I have a :WaitForChild in this part
script.Parent.Sound:Play()
remoteEvent:FireAllClients(text)
wait(0.235)
script.Parent:Destroy()
end)
please help, ty
