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

Script works in studio but not in game?

Here is my script. It works (almost) perfectly in studio, but doesn't work AT ALL in game. Why?

EDIT: Now the script doesn't work in Studio either. Whoop-de-doo. It used to work perfectly. I changed NOTHING


repeat
	wait()
	
game.Workspace.dungeon:Play()	
	
local hint = Instance.new('Hint', Workspace)
hint.Text = "Beginning the game.."
wait(20)
hint:Destroy()

game.Workspace.dungeon:Stop()


modelOfBricks = game.Workspace.spawnwalls
nameOfBricks = "spawnwall"

for i,v in pairs(modelOfBricks:GetChildren()) do
    if v.Name == nameOfBricks then
        v.Transparency = 1
		v.CanCollide=false
    end
end

game.Workspace.boss3:Play()

local hint = Instance.new('Hint', Workspace)
hint.Text = "Go go go!"
wait(4)
hint:Destroy()


game.Lighting.Venomshank:Clone().Parent = game.Workspace
game.Lighting.Darkheart:Clone().Parent = game.Workspace
game.Lighting.Illumina:Clone().Parent = game.Workspace

wait(180)
for i, player in ipairs(game.Players:GetPlayers()) do
	if player.Character then
		local hum = player.Character:FindFirstChild('Humanoid')
		if hum then
			hum.Health = 0
		end
	end
end

game.Workspace.boss3:Stop()

local stat = "KOs"
local players = game.Players:GetPlayers()

for i,v in pairs(players) do 
    if v.leaderstats then
        local lstat = v.leaderstats:FindFirstChild(stat)
        if lstat then
            lstat.Value = 0 
        end
    end
end

local hint = Instance.new('Hint', Workspace).
hint.Text = "The round has ended"
wait(4)
hint:Destroy()


modelOfBricks = game.Workspace.spawnwalls
nameOfBricks = "spawnwall"

for i,v in pairs(modelOfBricks:GetChildren()) do
    if v.Name == nameOfBricks then
        v.Transparency = 0
		v.CanCollide=true
    end
end

until 1+1==3

1 answer

Here's my suggestion for things that work in studio, but not in Online Play.

Go into a published server of your game

Press F9 (or ctrl+F9 for certain computers)

-This opens the server output (just like studio) -Its called Developer Console

While looking at the Developer Console, do whatever it is you do to run the script. Your problem should show up on the list

Tip

I recommend using this for a lot of different things, if your game doesn't have admin, but you want to kick a player, you can do it through this. :D (if you want more info, let me know on ROBLOX)

If this helped please accept the answer!

If you have any problems or questions, let me know

THANKS!

1 comment

0

I did that, but didn't see any direct errors for that particular script. Hmm

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