Hi guys!
I have a question about a crazy script. lol
So... How can I make a script, if Player touches the brick, the brick disappear, and spawns in a randomly spot in the map. I want to make delay, if the player touches the brick, the brick is disappear and wait(5), and the brick spawns in a random spot in the map.
I'm feeling nice, I will write the code for you, even though I'm not supposed to.
1 | script.Parent.Touched:Connect( function (prt) |
2 | wait( 5 ) |
3 | if prt.Parent:FindFirstChild( "Humanoid" ) then -- makes sure a player has touched |
4 | script.Parent.Position = Vector 3. new(math.random( 0 , 300 ) , 0.5 ,math.random( 0 , 300 )) |
5 | -- 0.5 is the Y value so it stays on the ground, everything else is a random value within baseplate(You should adjusted it to your needs) |
6 | end |
7 | end ) |