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

Player needs to join brand new server after joining group?

I have been told players have not been getting their group perks after joining the group, and the script will only function after a brand new server is created.

--Give group perks
game.Players.PlayerAdded:Connect(function(newPlayer)
wait(1)   
	if newPlayer:IsInGroup(4071812) and newPlayer:WaitForChild("Data").GroupPerk.Value == false then                    
      newPlayer.leaderstats.Money.Value = newPlayer.leaderstats.Money.Value + 1000
	workspace:WaitForChild(newPlayer.Name).Humanoid.WalkSpeed = 20
	  newPlayer.Data.GroupPerk.Value = true    
	  
	newPlayer.CharacterAdded:Connect(function()
	  
	if newPlayer:IsInGroup(4071812) then
	local char = game.Workspace:WaitForChild(newPlayer.Name)
  
	workspace:WaitForChild(newPlayer.Name).Humanoid.WalkSpeed = 20
	else
		workspace:WaitForChild(newPlayer.Name).Humanoid.WalkSpeed = 16	
	end
	end)
	   end
	
end)

I wanted it to check every single time someone joins

1 comment

0

use http requests. Roblox syncs don't update multiple times.

1 answer

Oddly enough, IsInGroup is cached on the server but not the client (according to the wiki). I would just tell the user to join a new server, or as oftenz suggested use Roblox's web API. Anything is better than getting the information from the client and using it on the server.

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