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

My RemoteEvent isn't firing..?

Asked by 5 years ago
Edited 5 years ago

So I want to spawn in my game with a RP Name, I have a remote to load me into the game from the menu, but it's not firing, no errors, nothing.

What's supposed to fire it:

game:GetService("ReplicatedStorage"):WaitForChild("Client").Event:Connect(function(...)
    local args = {...}
    if args[1] == "clicked_START" and args[2] ~= "" and #args[2] <= 24 and args[3] then
        StartGame()
        game:GetService("ReplicatedStorage"):WaitForChild("LoadCharacter"):FireServer({Name = args[2],SkinColor = args[3]})
    elseif args[2] == "" then
        Player.PlayerGui:WaitForChild("Menu"):WaitForChild("MainGUI"):WaitForChild("RPName"):WaitForChild("RPInput").PlaceholderText = "INPUT A RP NAME."
    elseif #args[2] > 24 then
        Player.PlayerGui:WaitForChild("Menu"):WaitForChild("MainGUI"):WaitForChild("RPName"):WaitForChild("RPInput").Text = ""
        Player.PlayerGui:WaitForChild("Menu"):WaitForChild("MainGUI"):WaitForChild("RPName"):WaitForChild("RPInput").PlaceholderText = "RP NAME EXCEEDS 24 LETTERS."
    end
end)

game:GetService("ReplicatedStorage"):WaitForChild("Client"):Fire("clicked_START",frame:WaitForChild("RPName"):WaitForChild("RPInput").Text,frame:WaitForChild("SkinColor"):WaitForChild("CurrentColor").BackgroundColor3)

Remote:

ReplicatedStorage:WaitForChild("LoadCharacter").OnServerEvent:connect(function(player,playertbl)
    print('LoadCharacter fired')
    local RPName = playertbl.Name
    local SkinColor = playertbl.SkinColor
    if #RPName <= 24 and RPName ~= "" then
        local Character = player.Character
        if Character then
            local ArmorVal = player:WaitForChild("Data"):WaitForChild("Armor").Value
            local MyArmor = Armor.Give(player,ArmorVal)
            SetupAnimation(Character:WaitForChild("Animate"))
            local Head = Character:WaitForChild("Head")
            local Humanoid = Character:WaitForChild("Humanoid")
            Humanoid.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
            Humanoid.NameDisplayDistance = Enum.HumanoidDisplayDistanceType.None
            local RPTag = ReplicatedStorage:WaitForChild("RPName"):Clone()
            local FilteredObject = GetTextObject(RPName,player.UserId)
            local FilteredString = GetFilteredMessage(FilteredObject)
            RPTag:FindFirstChild("Main"):FindFirstChild("RPName").Text = FilteredString
            RPTag:FindFirstChild("Main"):FindFirstChild("RobloxName").Text = player.Name
            RPTag.Parent = Head
            MyArmor:Equip()
            ChangeSkinColor(Character,SkinColor)
            local RootPart = Character:WaitForChild("HumanoidRootPart")
            RootPart.CFrame = workspace:WaitForChild("Map"):WaitForChild("GameSpawn").CFrame
        end
    end
end)

It does NOT output 'LoadCharacter fired'

0
Oh god the indentation HomieFirePGN 137 — 5y
0
Whats the top line for? Prestory 1395 — 5y
0
I believe on the last line of the fire script you gotta do :FireServer and not :Fire. Please message me back if this didn;t fix it CaptainEmpyreus 0 — 5y
0
Read the comment on the answer. sweettart13947 105 — 5y
View all comments (5 more)
0
line 1 is not doing anything, you cant do .Event:Connect(function() Gameplayer365247v2 1055 — 5y
0
I'm assuming that you have a variable named ReplicatedStorage on the Remote script? BennyBoiOriginal 293 — 5y
0
Yeah I have a variable called ReplicatedStorage which is just game:GetService("ReplicatedStorage") sweettart13947 105 — 5y
0
You used a little 'c' for :Connect, it won't work as well. Tweakified 117 — 5y

Answer this question