Hi, I was working on getting this script to send a notification to the player whenever one of the hunter has a spectate tool equipped. I'd like to keep it a localscript.
repeat wait() until game.Players.LocalPlayer.Character:IsDescendantOf(workspace) local Character = game.Players.LocalPlayer.Character function CHECK_TOOL(character) for _, v in pairs(character:GetChildren()) do if v:IsA("Spectate") then game:GetService("StarterGui"):SetCore("SendNotification", { Title = "Spectate Detected!"; Text = "Hide!"; }) end end end
It's because "Spectate" isn't a class, IsA checks the class/instance type of an object. Instead, do: if v.Name=='Spectate' and v:IsA'Tool' then