Hello, im new to creating games and know next to nothing about scripting and i followed a channels instructions on scripting minigames. i am trying to create a fps but was using his tutorial for the intermission, spawn in the map, etc. But everytime i test the game it says:
13:32:52.939 - Button is not a valid member of ScreenGui
Do you know how to fix this?
--// Tables Winners = {}
--// Modules Settings = require(script.Settings)
--// Game Variables Intermission = Settings.Intermission GameTime = Settings.GameTime
--// Functions function ChangeText(Text) local Players = game.Players:GetPlayers() for i = 1, #Players do Players[i].PlayerGui.Main.Time.Text = Text end end
function GetMap() local Maps = game.ReplicatedStorage.Maps:GetChildren() local PickMap = math.random(1, #Maps) local SelectedMap = Maps[PickMap]:Clone() SelectedMap.Name = 'Map' SelectedMap.Parent = game.Workspace end
function RemoveMap() if game.Workspace:FindFirstChild('Map') then game.Workspace.Map:remove() end end
--// Game while true do for i = Intermission, 0, -1 do ChangeText('Intermission... ' ..i) wait(1) end
local Players = game.Players:GetPlayers()
for i = 1, #Players do
Players[i].Playing.Value = true
end
ChangeText('Game Starting...')
wait(2)
GetMap()
wait(1)
local Players = game.Players:GetPlayers()
for i = 1, #Players do
if Players[i].Playing.Value == true then
local Spawn = game.Workspace.Map.Spawns.Spawn
Players[i].Character.Torso.CFrame = CFrame.new(Spawn.Position)
Spawn:remove()
Players[i].Character.Humanoid.WalkSpeed = 0
end
end
ChangeText('Round Starting...')
wait(5)
local Players = game.Players:GetPlayers()
for i = 1, #Players do
if Players[i].Playing.Value == true then
Players.Character.Humanoid.Walkspeed = 16
end
end
ChangeText('Begin!')
wait()
for i = GameTime, 0, -1 do
ChangeText('GameTime ' ..i)
wait(1)
end
local Players = game.Players:GetPlayers()
for i = 1, #Players do
if Players[i].Playing.Value == true then
table.insert(Winners, Players[i].Name)
Players[i].leaderstats.Money.Value = Players[i].leaderstats.Money.Value + 75
Players[i].leaderstats.Wins.Value = Players[i].leaderstats.Wins.Value + 1
Players[i].Character.Humanoid.Health = 0
Players[i].Playing.Value = false
end
end
RemoveMap()
ChangeText('Game Over!')
wait(5)
end

5 comments
No one can help you because you show no script, show script for help
that help?
"Button is not a valid member of ScreenGui" means that in ScreenGui there is no element named "Button"
where does it say button?
I have also been getting this error. I dont know how to fix this either. 14:14:50.317 - ServerScriptService.Main:21: bad argument #2 to 'random' (interval is empty)