hit.Parent:FindFirstChildWhichIsA("Humanoid") and game:GetService("Players"):GetPlayerFromCharacter(hit.Parent) = game:GetService("Players").LocalPlayer If it's not just anyone that can touch it, then put all this script in a LocalScript instead and replace the below check with: We need to check if the parent has a Humanoid (a character) but for a sanity check, get the player object from character. Added an anchored in here since now the part isn't always constantly changing positions. Local Clone = :Clone()Ĭlone.Position += Vector3.new(RandomNumber, 0, RandomNumber2) Local RandomNumber2 = math.random(-27,27) Additionally, you don't need to pass it nil, if there's no parameter, the default is nil. You don't actually have to do while true do, you can embed the wait in here if it'll always run. Hello is this what you were after? local db = true > Clone.Position += Vector3.new(RandomNumber, 0, RandomNumber2) > Clone.BrickColor = BrickColor.new "Gold" > local RandomNumber2 = math.random(-27,27) > local RandomNumber = math.random(-27,27) So, I’m now stuck on how to repeat the process. However, after I touch the cylinder to delete it, nothing else happens. I’m currently trying to make a minigame where, using math.random, cylinders will appear in random spots, and you must touch them to make another one spawn, and it should keep going.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |