Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

1 comment

0

I am using "Towers" as a holder.

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.