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

I am trying to have a hint display when a group's ally enters the server but...?

Asked by 10 years ago

I am having a hard time with getting this all right, so here's the code:

allies = {1100570, 334531, 1125280, 372807, 1181800, 44565}

function isPlayerAlly(leID)                                
    for _,x in pairs(allies)do                             
            if leID == x then                           
            return true  
        end 
    end
end 

function PlayerAdded(player)
if player:IsInGroup(leID) 
Msg=Instance.new("Hint",Workspace)
Msg.Text = ("Ally "..player.Name.." has entered the server!")
wait(5)
Msg:Destroy()
end 
end
game.Players.PlayerAdded:connect(PlayerAdded)

I created a table of group id numbers, since I didn't see any other way of doing this. Warning: I am quite novice, soooo sorry if my coding looks really ugly to you. ;-;

1
Well, what are you trying to do and what are the problems with the code? Tkdriverx 514 — 10y
0
@tkdriverk, fixed the question and body. I hope that gives you guys a better understanding of what I am trying to achieve. AlexandrosDeAngulo 0 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago
allies = {1100570, 334531, 1125280, 372807, 1181800, 44565}




game.Players.PlayerAdded:connect(function (plyr)


for i,v in pairs(allies) do
if plyr:IsInGroup(v) then
Msg=Instance.new("Hint", workspace) 
Msg.Text = ("Ally "..plyr.Name.." has entered the server!") 
wait(5) 
Msg:Destroy() 
end

end

end)
-- try this
Ad

Answer this question