Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Map selector not selecting maps after 0 seconds?

Asked by 4 years ago

I'm making a map selector for my game, The map gets selected but at 0 seconds it becomes negative and doesn't switch the map.

01local timeleft = 25
02local timecounter = Instance.new("Hint",workspace)
03function mapselect()
04    local random = math.random(1,#game.Lighting.Maps:GetChildren())
05    if random == 1 then
06        game.Lighting.Maps.forest.Parent = workspace   
07        return "forest"
08    elseif random==2 then
09        game.Lighting.Maps.neighbourhood.Parent = workspace
10        return "neighbourhood" 
11    elseif random==3 then
12        game.Lighting.Maps.house.Parent = workspace
13        return "house" 
14    elseif random==4 then
15        game.Lighting.Maps.city.Parent = workspace
View all 34 lines...

1 answer

Log in to vote
1
Answered by 4 years ago

if timeleft == "0" then change the "0" into 0 timeleft is a number not a string

0
oh thats a horrible mistake i made because i was detecting if textcounter.text was "0" thanks for telling me this antoniorigo4 117 — 4y
Ad

Answer this question