I made this Gui That allows you to had an item to a certain person. This GUI has a point system leaderboard for a group. The only problem is I want only a certain rank to see the Gui but for some reason everyone sees it. Here is the scripts.
This is checking the player
Player = game.Players.LocalPlayer if Player:IsInGroup(156524080) and Player:GetRankInGroup(156524080) >= 12 then script.Parent.Visible = true end
The Button Being Clicked
script.Parent.MouseButton1Click:connect(function() game.Players.LocalPlayer.leaderstats.Points.Value = game.Players.LocalPlayer.leaderstats.Points.Value + 1 end) Player = game.Players.LocalPlayer if Player:IsInGroup(1148696) and Player:GetRankInGroup(1148696) >= 21 then script.Parent.Parent.Visible = true else script.Parent.Parent.Visible = false end
The Leaderboard
players = game:GetService('Players') startingcash = 0 -- Variables players.PlayerAdded:connect(function(plr) local stats = Instance.new('IntValue') local cash = Instance.new('IntValue') stats.Name = 'leaderstats' cash.Name = 'Points' cash.Parent = stats cash.Value = startingcash stats.Parent = plr local AddPointGui = script.Parent.Parent.StarterGui.HandtoGui.Accept.Yes AddPointGui.MouseButton1Click:connect(function() cash.Value = cash.Value + 1 end) end) ---------------------------------------------------------------