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

Hints work in studio, but not in-game! Why is that?

Asked by 9 years ago

Hey guys,

I have recently got a bug where the hints work in the studio testing, but they don't appear when in-game. Does anyone see a problem as unfortunately I don't!

Delay = 20
ZombieAttackTime = 45
Message = Instance.new("Hint")
Message.Parent = workspace

while true do
        for i = 1, Delay*1 do
        Message.Text = "The Next Race will begin in " .. Delay*1-i
        wait(1)
        end
    local msg = Instance.new("Message")
    msg.Parent = game.Workspace
    msg.Text = ("Course : Original by Michael007800")
    wait(5)
    msg:remove()
    local New = Instance.new("Message")
    New.Parent = workspace
    New.Text = "THE RACE HAS BEGUN!!!!!"
    game.Lighting.Map1:clone().Parent = game.Workspace
    script.Sound1:play()
    script.RaceStart1:play()
    script.RaceStart2:play()
    script.RaceStart3:play()
    script.RaceStart4:play()
    script.RaceStart5:play()
    script.Parent.CanCollide = false
    script.Parent.Transparency = 1
    wait(3)
    New:remove()
    wait(2)
    script.Parent.CanCollide = true
    script.Parent.Transparency = 0
        for i = 1, ZombieAttackTime*1 do
        Message.Text = "The Next Race will end in " .. ZombieAttackTime*1-i
        wait(1)
    end
    local New = Instance.new("Message")
    New.Parent = workspace
    New.Text = "THE RACE HAS ENDED!!!!!"
    game.Workspace.Map1:remove()
    script.Sound1:stop()
    script.Parent.CanCollide = true
    script.Parent.Transparency = 0
    wait(3)
    New:remove()


            for i = 1, Delay*1 do
        Message.Text = "The Next Race will begin in " .. Delay*1-i
        wait(1)
        end
    local msg = Instance.new("Message")
    msg.Parent = game.Workspace
    msg.Text = ("Course : Dark Stadium by darksideday")
    wait(5)
    msg:remove()
    local New = Instance.new("Message")
    New.Parent = workspace
    New.Text = "THE RACE HAS BEGUN!!!!!"
    game.Lighting.Map2:clone().Parent = game.Workspace
    script.Sound2:play()
    script.RaceStart1:play()
    script.RaceStart2:play()
    script.RaceStart3:play()
    script.RaceStart4:play()
    script.RaceStart5:play()
    script.Parent.CanCollide = false
    script.Parent.Transparency = 1
    wait(3)
    New:remove()
    wait(2)
    script.Parent.CanCollide = true
    script.Parent.Transparency = 0
        for i = 1, ZombieAttackTime*1 do
        Message.Text = "The Race will end in " .. ZombieAttackTime*1-i
        wait(1)
    end
    local New = Instance.new("Message")
    New.Parent = workspace
    New.Text = "THE RACE HAS ENDED!!!!!"
    game.Workspace.Map2:remove()
    script.Sound2:stop()
    script.Parent.CanCollide = true
    script.Parent.Transparency = 0
    wait(3)
    New:remove()

end 

Thanks in advanced,

Michael

(Due to 10,000 character limit, I had to cut the script down!)

0
The Message object is very old and almost everyone has stopped using it due to its bugginess, which could be causing this. Id recommend just putting it in a SurfaceGUI, drew1017 330 — 9y
0
I will do when I finish off tracks and an happy with everything. I'm using Hints and Messages however ATM as it's just easier. Michael007800 144 — 9y
0
Changed my mind, I'll change to GUIs! Michael007800 144 — 9y
0
You changed it... So everything I did was useless... lol jkjk i'm fine. But messages and hints are not buggy. EzraNehemiah_TF2 3552 — 9y
0
Yeah, which is why I decied to go back with messages and GUIs. I'm not an advacned enough scripter! :D Michael007800 144 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago
Delay = 20
ZombieAttackTime = 45

function hint(text,time) --Hint Function
    local Message = Instance.new("Hint",workspace)
    Message.Text = text
    game:GetService("Debris"):AddItem(Message, time) --Add Item from Debris service
end

function message(text, time) --Message Function
    local msg = Instance.new("Message",workspace)
    msg.Text = text
    game:GetService("Debris"):AddItem(Message, time)--Same thing
end

while true do
        for i = Delay,0,-1 do --Changed this to this format
        hint("The Next Race will begin in " .. i, 1) --Changed the hints into functions
        wait(1)
        end
    message("Course : Original by Michael007800", 5)--Same thing with messages
wait(5)
    message("THE RACE HAS BEGUN!!!!!", 3)
    game.Lighting.Map1:clone().Parent = game.Workspace
    script.Sound1:play()
    script.RaceStart1:play()
    script.RaceStart2:play()
    script.RaceStart3:play()
    script.RaceStart4:play()
    script.RaceStart5:play()
    script.Parent.CanCollide = false
    script.Parent.Transparency = 1
    wait(5)
    script.Parent.CanCollide = true
    script.Parent.Transparency = 0
        for i = 1, ZombieAttackTime*1 do
        Message.Text = "The Next Race will end in " .. ZombieAttackTime*1-i
        wait(1)
    end
    message("THE RACE HAS ENDED!!!!!", 3)
    game.Workspace.Map1:Destroy()
    script.Sound1:stop()
    script.Parent.CanCollide = true
    script.Parent.Transparency = 0
wait(3)

            for i = Delay,0,-1 do
        hint("The Next Race will begin in " ..i,1)
        wait(1)
        end
     message("Course : Dark Stadium by darksideday",5)
wait(5)
    message("THE RACE HAS BEGUN!!!!!", 3)
    game.Lighting.Map2:clone().Parent = game.Workspace
    script.Sound2:play()
    script.RaceStart1:play()
    script.RaceStart2:play()
    script.RaceStart3:play()
    script.RaceStart4:play()
    script.RaceStart5:play()
    script.Parent.CanCollide = false
    script.Parent.Transparency = 1
    wait(5)
    script.Parent.CanCollide = true
    script.Parent.Transparency = 0
        for i = ZombieAttackTime,0,-1 do
       hint("The Race will end in " ..i,1)
        wait(1)
    end
    message("THE RACE HAS ENDED!!!!!",3)
    game.Workspace.Map2:Destroy()
    script.Sound2:stop()
    script.Parent.CanCollide = true
    script.Parent.Transparency = 0
    wait(3)
end 

Hope This Helps!

Ad

Answer this question