I have tried this,
local test = math.random(1,8)
local platform = "Platform"..test
workspace.Map.platform.canCollide = false
But it wont work. Please help!
I have tried this,
local test = math.random(1,8)
local platform = "Platform"..test
workspace.Map.platform.canCollide = false
But it wont work. Please help!
Line 4 of your code is the problem because it searches for an Instance named "platform" in game.Workspace.Map. Also the property is typed like this: CanCollide whereas in your code you left the first c lowercased. What you should do is one of these two things:
game.Workspace.Map[platform].CanCollide = false
--or
game.Workspace:FindFirstChild(platform).CanCollide = false
Both will rise an error if the allocation evaluates to nil.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
You can manually set 'CanCollide**' to false, as you have no need to adjust it with your code from the context I'm seeing.
I need it to be random