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

Why doesn't my GUI show up when I say the correct sentence?

Asked by 5 years ago

This question has been solved by the original poster.

I added print to help me identify the problem. This script fires the remote fine but when it gets to the local script it doesn't really work any ideas?

--Server
local Players = game:GetService("Players")
local remote = game:GetService("ReplicatedStorage"):WaitForChild("host")

game.Players.PlayerAdded:Connect(function(Player)
    if Player:GetRankInGroup(4117755) >= 199 then
        Player.Chatted:Connect(function(Message)
            if Message ~= nil then 
                if string.lower(string.sub(Message, 1 , 5)) == "start" then
                     print("fireing")
                   remote:FireAllClients()
print("fired")
end
            end
        end)
    end
end)
--Local and in the gui
local plr = game:GetService("Players").LocalPlayer
local remote = game:GetService("ReplicatedStorage"):WaitForChild("start")

remote.OnClientEvent:Connect(function()
    script.Parent.Visible = true 
end)

--Errors
Players.PlayerGui.ScreenGui.LocalScript:5: bad argument #3 to 'Text' (string expected, got nil)
0
Nevermind I figured it out :) voidofdeathfire 148 — 5y
0
gg starmaq 1290 — 5y

Answer this question