Collision Filtering specific group rand or higher? [closed]
Asked by
7 years ago Edited 7 years ago
I am having trouble with collision filtering. I made a script that would let only players in a specific rank or higher in the group go through the door. This is my script and it doesn't work. I am not very good at scripting.
03 | local plyr = game.Players.LocalPlayer |
04 | local PhysicsService = game:GetService( "PhysicsService" ) |
05 | local wallGroup = "WallGroup" |
08 | PhysicsService:CreateCollisionGroup(wallGroup) |
09 | PhysicsService:CreateCollisionGroup(Group) |
11 | local wall = game.Workspace [ "Rank Door" ] |
12 | local Groupplayer = plyr~ = nil and plyr:IsInGroup(group) = = true and plyr:GetRankInGroup(group)> = rank |
14 | PhysicsService:SetPartCollisionGroup(wall, wallGroup) |
15 | PhysicsService:SetPartCollisionGroup(Groupplayer, Group) |
17 | PhysicsService:CollisionGroupSetCollidable(wallGroup, Group, false ) |
here is my old script that didnt use collision filtering and it let others (who werent allowed in), in with the player who is allowed to go in. Soo it didnt work out so well. I dont want a script like this please. I need to us collision filtering on this.
04 | script.Parent.Touched:connect( function (p) |
05 | while p.Parent.Name~ = "Workspace" do |
08 | local plyr = game.Players:FindFirstChild(p.Name) |
09 | if plyr~ = nil and plyr:IsInGroup(group) = = true and plyr:GetRankInGroup(group)> = rank then |
10 | script.Parent.CanCollide = false |
11 | script.Parent.Transparency = 1 |
13 | script.Parent.CanCollide = true |
14 | script.Parent.Transparency = 1 |
Marked as Duplicate by hiimgoodpack, DragonOfWar900, and PyccknnXakep
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?