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)
if (player.Name:GetRankInGroup(2551575) >= 239) then
platform.CanCollide = false
end
end
Players.PlayerAdded:connect(onPlayerAdded)
COMMUNITY QUESTION
How come the last part of my code doesn't work?
1 answer
The Player function :GetRankInGroup() is a function of the player object, not the name of the player. On line 12, you were trying to use it on the player's name, not the player themselves.
Thus, it can be changed to this:
local Players = game:GetService("Players")
local platform = Instance.new("Part")
platform.CFrame = CFrame.new(12.5, 1.71, 17.43)
platform.Anchored = true
platform.Transparency = .5
platform.Size = Vector3.new(5, 10, 1)
platform.Parent = workspace.CurrentCamera
function onPlayerAdded(player)
if (player:GetRankInGroup(2551575) >= 239) then
platform.CanCollide = false
end
end
Players.PlayerAdded:connect(onPlayerAdded)
1 comment
0
Still doesnt work
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
You have not connected the function to the event?
WHat you mean