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

The last part of my code doesn't work?

-- attempt to find a container; create a new one if it doesn't exist
local container = game.Workspace:FindFirstChild("LocalBin")
if not container then
    container = Instance.new("Camera")
    container.Name = "LocalBin"
    container.Parent = game.Workspace
end
 
-- 'container' will be used to contain all local parts. Below I copied the code from
-- before to create a local platform.
 local platform = Instance.new("Part")
platform.Parent = game.Workspace.LocalBin
platform.CFrame = CFrame.new(12.5, 1.71, 17.43)
platform.Anchored = true
platform.Transparency = .5
platform.Size = Vector3.new(5, 10, 1)
game.Players.PlayerAdded:connect(function(Player)
	if Player:GetRankInGroup(2551575) >= 239 then
		game.Workspace.LocalBin.Part.CanCollie = false
	end
end)

Everything works up until game.Players.PlayerAdded and I'm trying to make a part people above that rank in my group can walk through

5 comments

0

It's because you got a spelling wrong game.Workspace.LocalBin.Part.CanCollide = false It should be like that

0

Still doesnt work

0

Were there any error messages?

0

Try checking the output

0

You could do this easier by putting the platform inside of the CurrentCamera and not having to create a container.

1 answer

✓ Accepted answer

If this is a script, the camera wont belong to anyone.

If this is a localscript, the function will never run for the player as it will not run the PlayerAdded for that player.

Local instances should only be created by a LocalScript, inside game.Workspace.CurrentCamera

1 comment

0

So I should just put the part in the camera

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