Roblox Scripting Tutorial Collision Group
Описание
Read me :
[[INCREASE VOLUME TO HEAR MY VOICE]]
So yeah another roblox scripting tutorial by me. Its about collision group id that has come out from roblox like a few months ago maybe already lots of month. I know I'm outdated.
Model Link : https://www.roblox.com/catalog/01733617620/redirect
Scripts :
CollisionGroup Creator :
local physicsService = game:GetService("PhysicsService")
physicsService:CreateCollisionGroup("Door")
physicsService:CreateCollisionGroup("PlayerCharacter1")
physicsService:CreateCollisionGroup("PlayerCharacter2")
physicsService:CollisionGroupSetCollidable("Door", "PlayerCharacter1", false)
physicsService:CollisionGroupSetCollidable("Door", "PlayerCharacter2", true)
Door:
wait(2)
local physicsService = game:GetService("PhysicsService")
local door = script.Parent
physicsService:SetPartCollisionGroup(door, "Door")
PlayerCharacter :
local character = script.Parent
local player = game:GetService("Players"):GetPlayerFromCharacter(character)
local value = player:WaitForChild("PlayerScripts"):WaitForChild("PlayerType")
local physicsService = game:GetService("PhysicsService")
for i,v in pairs(character:GetChildren())do
if v:IsA("BasePart") then
--physicsService:SetPartCollisionGroup(v, "")
if value.Value == "PlayerCharacter1" then
physicsService:SetPartCollisionGroup(v, "PlayerCharacter1")
end
if value.Value == "PlayerCharacter2" then
physicsService:SetPartCollisionGroup(v, "PlayerCharacter2")
end
end
end
Рекомендуемые видео



















