[로블록스 스튜디오] 특정 팀만 통과되는 파트 만들기
Вставка
- Опубліковано 7 лют 2025
- #로블록스스튜디오 #Mr지구공룡
스크립트
----------------------
-- 파트의 팀 필터를 설정
local part = script.Parent -- 이 스크립트를 부착한 파트를 가져옴
local teamName = "YourTeamName" -- 여기에 원하는 팀 이름을 넣어줘
-- 팀 필터 생성
local teamFilter = Instance.new("Team", game)
teamFilter.Name = teamName
-- 파트에 팀 필터 설정
part.Touched:Connect(function(hit)
local character = hit.Parent
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
local player = game.Players:GetPlayerFromCharacter(character)
if player and player.Team.Name ~= teamName then
-- 특정 팀이 아니면 통과하지 않음
part.CanCollide = true
else
-- 특정 팀이면 통과 가능
part.CanCollide = false
end
end
end)
혹시 여러 팀이 뚫리게 하려면 어떻게 해야하나요 ㅠㅠㅠ
저도 원하는데
진짜 어떻게 해야하지
@@Yun_7618 그럼 or 쓰세요
그다음 , "" 스셈
'
good