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

Why will the BindableEvent not fire in this script?

Asked by 3 years ago

This is the code I have that is supposed to fire it, I get "Brick Touched" to print. However I never get "maybe" to print so I believe it breaks on the Fire command.

local BindableEvent = game.ServerStorage:WaitForChild("Pass")

local debounce = false

script.Parent.Touched:Connect(function()
    if not debounce then
    debounce = true
    print("Brick Touched")
    BindableEvent:Fire()
    print("maybe")
wait(1)
end
end)

This is my receiver script

local GlitchURL = "Removed for Security" --Place the glitch project URL inside of the quotes
local BindableEvent = game.ServerStorage:WaitForChild("Pass")

function rankUser(UserID, RoleID)
    game:GetService("HttpService"):GetAsync(GlitchURL .. "ranker?userid=" .. UserID .. "&rank=" .. RoleID)
end

local UserID = 1234567 --Replace 12345 with the users userid
local RoleID = 123 --Replace 255 with the role id that you would like the user to be set to

rankUser(UserID, RoleID)

local Configuration = {
{10}
}

BindableEvent.Event:Connect(function(Player)
    for i = 1, #Configuration do
        local RankID = Configuration[i][1]
    rankUser(Player.UserID, RankID)
    print("Ranked!")
    end
end)

My bindable event is called "Pass" and it is located in ServerStorage.

0
It’s always waiting for a return from the server side I_Nev 200 — 3y
0
It’s always waiting for a return from the server side I_Nev 200 — 3y

Answer this question