What solutions have you tried so far? none because I dont understand it
here’s my code:
local player = game.Players.LocalPlayer
local Character = player.Character or player.CharacterAdded:Wait()
local RS = game:GetService("ReplicatedStorage")
local Explode = RS.Remotes:WaitForChild("Explode")
local mouse = player:GetMouse()
local UIS = game:GetService("UserInputService")
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://"
local debounce = false
local connect
player.Chatted:Connect(function(msg)
local spell = string.lower(msg)
if spell == "infalmmeatur" then
if not debounce then
debounce = true
if Character.Practitioner.Value == true then
if Character.Magic.Value > 65 then
connect = mouse.Button1Down:Connect(function()
local position = mouse.Hit.p
local Anim = Character:WaitForChild("Humanoid"):LoadAnimation(Animation)
Anim:Play()
Explode:FireServer(position)
end)
end
end
end
end
task.wait(10)
debounce = false
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
player.Chatted:Connect(function(msg)
local spell = string.lower(msg)
if spell == "infalmmeatur" then
if not debounce then
debounce = true
if Character.Practitioner.Value == true then
if Character.Magic.Value > 65 then
connect = mouse.Button1Down:Connect(function()
local position = mouse.Hit.p
local Anim = Character:WaitForChild("Humanoid"):LoadAnimation(Animation)
Anim:Play()
Explode:FireServer(position)
end)
end
end
task.wait(10)
debounce = false
end
end
end)
just set debounce to false inside the if statement, not outside
local player = game.Players.LocalPlayer
local Character = player.Character or player.CharacterAdded:Wait()
local RS = game:GetService("ReplicatedStorage")
local Explode = RS.Remotes:WaitForChild("Explode")
local mouse = player:GetMouse()
local UIS = game:GetService("UserInputService")
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://"
local debounce = false
local connect
player.Chatted:Connect(function(msg)
if debounce then
return
end
local spell = string.lower(msg)
if spell == "infalmmeatur" then
if Character.Practitioner.Value == true then
if Character.Magic.Value > 65 then
connect = mouse.Button1Down:Connect(function()
debounce = true
local position = mouse.Hit.p
local Anim = Character:WaitForChild("Humanoid"):LoadAnimation(Animation)
Anim:Play()
Explode:FireServer(position)
task.wait(10)
debounce = false
end)
end
end
end
end)