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

This script won't display the random map that is chosen? [ANSWERED BY SELF]

Asked by 7 years ago
Edited 7 years ago

I am make a Survive The Tsunami Type game but this weird error is happening can someone tell me what I am doing wrong?? Here is the main script:

ReplicatedStorage = game:GetService("ReplicatedStorage")
ServerStorage = game:GetService("ServerStorage")
Status = ReplicatedStorage.StatusValue

local maps = ServerStorage.Maps:GetChildren()
local chosenmap = "Towers"





function chosemap()
    local i = math.random(1, #maps)
    maps[i]:Clone().Parent = workspace
    chosenmap = maps[i]
end







for i = 5,1,-1 do -- Change 15 to how long you want to countdown
  Status.Value = "Intermission (" .. i .. ")"
wait(1)
end
chosemap()
Status.Value = "A tsunami will strike near: " .. chosenmap -- PROBLEM HERE



Here is the error I get: 19:00:18.820 - Workspace.MainScript:29: attempt to concatenate local 'chosenmap' (a userdata value)

0
I am using "Towers" as a holder. PixelZombieX 8 — 7y

1 answer

Log in to vote
1
Answered by 7 years ago

Ok nvm I fixed it, I frgt to put .Name after chosenmap = maps[i]

Ad

Answer this question