[SOLVED] Script not working. checks if player is player(check bottom for more info) ?
Asked by
2 years ago Edited 2 years ago
The script is supposed to check if player is a player and if the player is a player then it sets all parts in the model to CanCollide = false, but if its not a player then it sets CanCollide = true for al the parts in the Model. All the parts in the Model are named Cannotdelete. Why is the script not working?
01 | local Players = game:GetService( "Players" ) |
02 | local player = Players.LocalPlayer |
04 | local model = workspace.Grid.Model |
06 | for _, child in ipairs (model:GetChildren()) do |
07 | if child:IsA( "BasePart" ) then |
09 | child.CanCollide = false |
11 | child.CanCollide = true |