Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does my local script not fireserver ?

Asked by 4 years 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 4 years ago
Edited 4 years 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