script works on studio but not in game help please


  • i found an intermission script that start round everytime it works perfect on studio but when i play the game the script is not working i tried everything and found out that i have to use RemoteEvent and i dont know how to use it i searched guide how to and still dont know how to use it if someone can help me with the script it would be very nice thank you :D

    The Script:

    --// 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... Good luck!')
    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.Head.CFrame = CFrame.new(Spawn.Position)
    		Spawn:remove()
    		Players[i].Character.Humanoid.WalkSpeed = 0
    	end
    end
    
    for i = 5, 0, -1 do
    	ChangeText('Round Starting in  ' ..i)
    	wait(1)
    end	
    
    local Players = game.Players:GetPlayers()
    for i = 1, #Players do
    	if Players[i].Playing.Value == true then
    		Players[i].Character.Humanoid.WalkSpeed = 16
    	end
    end
    
    ChangeText('Begin!')
    
    for i = GameTime, 0, -1 do
    	ChangeText('Round over in ' ..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 + 10
    		Players[i].leaderstats.Wins.Value = Players[i].leaderstats.Wins.Value + 1
    		Players[i].Character.Humanoid.Health = 0
    		Players[i].Playing.Value = false
    		Players[i].PlayerGui.Main.MoneyShower.TextLabel.Visible = true
    	end
    end
    
    RemoveMap()
    ChangeText('Game over!')
    wait(4)	
    

    end


  • @XNetanelGrX said in script works on studio but not in game help please:

    i found an intermission script

    So a free model?


  • @XNetanelGrX yeah no. you're not being helped with free models, git gud and write your own code


    1. Don't ask for help without actually trying to help yourself and come to us with the problems after that.
    2. Don't post scripting questions on the forums.
Log in to reply
 

Looks like your connection to Scripting Helpers was lost, please wait while we try to reconnect.