local platform = Instance.new("Part") platform.Parent = game.Workspace.CurrentCamera platform.CFrame = CFrame.new(12.5, 1.71, 17.43) platform.Anchored = true platform.Transparency = .5 platform.Size = Vector3.new(5, 10, 1) local Players = game:GetService("Players") function onPlayerAdded(player) game.StarterGui.LocalScript:Clone().Parent = player if (player:GetRankInGroup(2551575) >= 239) then platform.CanCollide = false end end
I updated my code, as of 11:26 PM EST, I did what you said (I think) and it still does not work.
:IsInGroup() and :GetRankInGroup take integers, not strings. Get rid of the double quotes on the group ID and it should work.
Some other tips to improve your script:
:clone()
is deprecated in favor of :Clone()
:GetRankInGroup()
returns 0 for a non-member, so the :IsInGroup()
call isn't required.
Your print()
call is concatenating an empty string with player.Name. The ""..
part can be removed.
Items in StarterGui are cloned to the player's PlayerGui automatically. Try moving the cloned script to ReplicatedStorage or ServerStorage instead.