Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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. ;-;

2 comments

1

Well, what are you trying to do and what are the problems with the code?

0

@tkdriverk, fixed the question and body. I hope that gives you guys a better understanding of what I am trying to achieve.

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.