Also, math.Random(0,4)
WONT WORK
So, i am making something so this briefcase will teleport to 1 of 4 positions. The script works fine, but its always picking position one. Can someone help me?
local map = "hub" local pick = 0 local CSPAWN = 0 pick = math.random(1) if pick == 1 then map = "concept" print(map) end if map == "concept" then CSPAWN = math.random(4) if CSPAWN == 1 then game.Workspace.Maps.Concept["The concept suitcase!"].Handle.Position = Vector3.new(-422.5, 1.5, -98.7) end if CSPAWN == 2 then game.Workspace.Maps.Concept["The concept suitcase!"].Handle.Position = Vector3.new(-355.5, 1.5, -184.55) end if CSPAWN == 3 then game.Workspace.Maps.Concept["The concept suitcase!"].Handle.Position = Vector3.new(-239.95, 1.5, -110.95) end if CSPAWN == 4 then game.Workspace.Maps.Concept["The concept suitcase!"].Handle.Position = Vector3.new(-335.3, 1.5, -60.8) end print(CSPAWN) end
I think I understand your point. Unless you randomize the seed the script will print the exact same number each time
You can do this by adding math.randomseed(tick())
to the very beginning of your script and it should produce a random number each time you do math.random(4)
The reason the only reason its picking one, is its the only reason to pick! The first argument is the lowest number the value to get, and the second variable is the highest it can get.
well, the first one is SUPPOSED to be 1. i was talking about the variable CSPAWN. I tried your method on CSPAWN but it just does 0 now! Sorry I am kinda a beginner scripter