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

Why this not Working in Online Server?

Asked by 9 years ago
local ID = 1038094
local GUI = game.ServerStorage.GUI1

game.Players.PlayerAdded:connect(function(Plr)
Plr.ChildAdded:connect(function()
if Plr:IsInGroup(ID) and Plr:GetRankInGroup(ID) >= 4 then
GUI:Clone().Parent = Plr.PlayerGui
end
end)
end)

1 answer

Log in to vote
0
Answered by 9 years ago

I see no point in using Plr.ChildAdded:connect(function() . You should be using ReplicatedStorage instead of ServerStorage So don't forget to move the GUI! Your code should look like this:

local ID = 1038094
local GUI = game.ReplicatedStorage.GUI1

game.Players.PlayerAdded:connect(function(Plr)
    if Plr:IsInGroup(ID) and Plr:GetRankInGroup(ID) >= 4 then
        GUI:Clone().Parent = Plr.PlayerGui
        end
end)
Ad

Answer this question