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

Local part function wont run?

 llocal 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
game.Players.PlayerAdded:connect(onPlayerAdded)

Please test this, this is my 5th time asking and every code I got was dysfunctional.

3 comments

0

You're wanting to do a LocalPart? This must be a LocalScript. In which case PlayerAdded would fail to execute properly in the script.

0

SO what do I do...

0

I don't know about this must you seem to have misspelled your "local" while assigning the variable "Players", and probably you have to put this script into LocalScript.

1 answer

You should find if they are in the group and what rank they are.

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)
	local Player = Game:GetService('Players'):GetPlayerFromCharacter(player)
	if Player:IsInGroup(2551575) >= 239 then   
	   platform.CanCollide = false
	end
end
game.Players.PlayerAdded:connect(onPlayerAdded)

1 comment

0

Welp I said to test it, and again it doesnt work.

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