Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make platforms pick a random color and turn off canColide on random?

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!

2 comments

0

You can manually set 'CanCollide**' to false, as you have no need to adjust it with your code from the context I'm seeing.

0

I need it to be random

1 answer

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

1 comment

0

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.