hello, im trying to make player collision off, but i have viewmodels to change the first person and collision groups so when i use other scripts it glitches the game bad, so im trying to make a script that gets players, make sures it isnt the local player, then gets decedents, makes sure its a meshpart or a part, then makes cancolldie off, any help?
local character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local function CollsionOff(player_)
local Player = game.Players
if Player.Name ~= game.Players.LocalPlayer.Name then
for i,v in pairs (Player.Character:GetDescendants()) do
if v:IsA("BasePart") or v:IsA("Decal") then
v.CanCollide= 1
end
end
end
end