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

Why isn't my RemoteEvent working?

Asked by 8 years ago

I have a RemoteEvent in ReplicatedStorage and in ServerScriptStorage I have a script running this:

local InputImageLibrary = require(408470686)

local event = game.ReplicatedStorage.indicatorEvent
print(event.Name)

event.onServerConnect:connect(function(player)
    local playerGui = player:WaitForChild("PlayerGui")
    local frame = playerGui.Shop.Frame      

    local Y = InputImageLibrary:GetImageLabel(Enum.KeyCode.ButtonY, "Dark")
    Y.Name = "yIndicator"
    Y.Parent = frame
    Y.Size = UDim2.new(0.19,0,0.1,0)
    Y.Position = UDim2.new(.81,0,0,0)

    while true do
        Y:TweenPosition(UDim2.new(1,10,0,0), "Out", "Elastic", 2, true)
        wait(10)
        Y:TweenPosition(UDim2.new(.81,0,0,0), "In", "Quad", .3, true)
        wait(3)
    end
end)

And in a LocalScript in the StarterGui I have:

if game:GetService("UserInputService").GamepadEnabled then
    print("gamepad enabled")
    game.ReplicatedStorage:WaitForChild("indicatorEvent"):FireServer()
end

Am I missing something? I followed the wiki and a couple other tutorials and It just doesn't seem to work for some reason.

Thank you in advance for any help.

1 answer

Log in to vote
0
Answered by 8 years ago

According to the Roblox API, the server event is named onServerEvent, not onServerConnect. Also, try firing your event with the proper arguments.

0
Thank you! This was an error, but the main error was that I had accidentally disabled the script. It works wonderfully now. FierceByte 25 — 8y
Ad

Answer this question