[SOLVED] Randomized X position always ending up in one place after one randomize?
Asked by
5 years ago Edited 5 years ago
In my previous question, I asked how I would make a randomized tree position every time a player chops it down. Fortunately, it was answered.
But the only thing is, that the after one randomized position, the tree always respawns in the same location. I have no idea why this happens, but it may be because of the code that was provided to me.
My current script:
01 | local random = math.random(- 100 , 100 ) |
02 | script.Parent.Changed:Connect( function () |
03 | if script.Parent.Value < = 0 then |
04 | script.Parent.Parent.CanCollide = false |
05 | script.Parent.Parent.Transparency = 1 |
06 | script.Parent.Parent.Name = "cooling" |
08 | script.Parent.Parent.Name = "tree" |
09 | script.Parent.Parent.Transparency = 0 |
10 | script.Parent.Value = 3 |
11 | script.Parent.Parent.CanCollide = true |
12 | script.Parent.Parent.Position = Vector 3. new(random,script.Parent.Parent.Position.Y,random); |
The script randomizes the first position of the tree, then it always respawns at the first randomized position.
Any help please?