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

Player needs to join brand new server after joining group?

Asked by 5 years ago

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

0
use http requests. Roblox syncs don't update multiple times. oftenz 367 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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.

Ad

Answer this question