So I just built this big block of code probably the biggest I have ever done and I was wondering why exactly the script was stopping at the point of saying that I wasn’t in the group, after checking 1 time per second for 10 seconds.
I think it’s the
game.Players.PlayerAdded:Connect(function(newPlayer) area but I’m unsure of how to fix it.
Can someone please explain why the following code is only getting that far?
local remoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("ChillRemoteEvent") local Chill = false local inGroup = false print("Starting first check") while true do wait(1) if game.StarterGui.Chill.Enabled==true then Chill=true print("Checked to see if Chill page was open, was") break end print("UI Check loop has been broken, moving on") end print("Starting check to see if player is in group") game.Players.PlayerAdded:Connect(function(newPlayer) if newPlayer:IsInGroup(6967967) then print ("Player is in Weird Games, Inc.!" ) inGroup = true else print("First check to see if player was in group failed. Trying 10 times, once every second, to see if they are really in the group") for count = 1,10,1 do wait(1) if newPlayer:IsInGroup(6967967) then print ("Player is in Weird Games, Inc.!" ) inGroup = true end end end end) if inGroup == false then print("Player is not in group, check will not continue") else if inGroup == true then print("Player is in the group, moving on...") else print("A really weird error has occurred.") end end if inGroup == true then local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local face = character:WaitForChild("Head"):WaitForChild("face") if face:IsA("Decal") then-- if it's a valid face, then... if face.Texture == "http://www.roblox.com/asset/?id=7074749" then print("Player is wearing Chill Face! Switching over to server script to handle role-changing...") remoteEvent:FireServer() end end end
Thanks for all the help, I believe this is just a small error