Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Why does my local script not fireserver ?

Asked by 7 days ago

the local script

local Player = game.Players.LocalPlayer
local mouse = Player:GetMouse()
local T = script.Parent
local handle = T:WaitForChild('Handle')
local debounce = false
local RemoteEvent = script.Parent.RemoteEvent
T.Activated:Connect(function()
    local H = T.Parent:FindFirstChildWhichIsA("Humanoid")
    if H and debounce ~= false then
        debounce = true
        local position = mouse.Hit.Position
        T.RemoteEvent:FireServer(position)
        wait(2)
        debounce = false
    end
end)

idk whats wrong so please help.

1 answer

Log in to vote
0
Answered by 7 days ago
Edited 7 days ago

The problem is at line 9. You're checking for the 'debounce' to be true when it's currently set at false. Consider changing the 'debounce' to true. (or debounce == false)

Ad

Answer this question