-- Services local RunService = game:GetService("RunService") local Players = game:GetService("Players") local UIS = game:GetService("UserInputService") local Teams = game:GetService("Teams") -- Instances local LocalPlayer = Players.LocalPlayer local Character = LocalPlayer.Character local Script = game:GetService("Players").LocalPlayer.PlayerScripts.EffectLocal Script:Destroy() -- Variables local Switch = false local Connection = nil -- Functions local function ToolCheck() if Character then for _, Tool in ipairs(Character:GetChildren()) do if Tool:IsA("Tool") then local Script = Tool:FindFirstChildWhichIsA("LocalScript") if not Script then continue end local RemoteEvent = Script:FindFirstChildWhichIsA("RemoteEvent") if not RemoteEvent then continue end return RemoteEvent end end return nil else return nil end end -- Event UIS.InputBegan:Connect(function(Key) if (Key.UserInputType == Enum.UserInputType.MouseButton1 or Key.UserInputType == Enum.UserInputType.Touch) then local RemoteEvent = ToolCheck() if RemoteEvent then RemoteEvent:FireServer() end elseif Key.KeyCode == Enum.KeyCode.Q then if Switch == true then Switch = false if Connection then Connection:Disconnect() Connection = nil else return end else Switch = true if Connection then Connection:Disconnect() Connection = nil end Connection = RunService.Heartbeat:Connect(function() local RemoteEvent = ToolCheck() if RemoteEvent then RemoteEvent:FireServer() end end) end else return end end) LocalPlayer.CharacterAdded:Connect(function(Char) Character = Char if game:GetService("Players").LocalPlayer.PlayerScripts.EffectLocal then game:GetService("Players").LocalPlayer.PlayerScripts.EffectLocal:Destroy() end end)