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

How to fix remote events not firing?

Asked by
Meqolo 78
6 years ago

I've tried to create a handcuff script, however my remote event does not appear to be firing.

Localscript code:

local UIS = game:GetService("UserInputService")
script.Parent.Equipped:Connect(function(Mouse)
    UIS.InputBegan:Connect(function(input, GP)
        if input.UserInputType == Enum.UserInputType.MouseButton1 then
            if script.plr.Value == "" then
                script.plr.Value = tostring(Mouse.Target.Parent.Name)
                if Mouse.Target ~= nil then
                    if Mouse.Target.Parent:FindFirstChild("Humanoid") then
                        print("a")
                        print(script.plr.Value)
                        game:GetService("ReplicatedStorage").Handcuff:FireServer(script.plr.Value, "Cuff")
                        print("b")
                    end
                end
            else

            end
        end
    end)
end)

Serverscript code:

game:GetService("ReplicatedStorage").Handcuff.OnServerEvent:Connect(function(plr,otherplr,state)
    print("a")
    print(plr)
    print(otherplr)
    print(state)
end)

Nothing in the serverscript is being ran.

1 answer

Log in to vote
0
Answered by
Meqolo 78
6 years ago

Nvm, fixed it

Ad

Answer this question