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

my script dosent work and it shows nothing on the output how to fix?

i made a script but its not working the thing that it is supposed to do is make the sun appear on click and make it look like its going to explode with sunrays effect

here is the script: it also dosent show anything on the output

script.Parent.ClickDetector.MouseClick:Connect(function()
	print ("TheSunIsADeadlyLaser")
	game.Lighting.Sky.CelestialBodiesShown = true
	game.Lighting.SunRays.Enabled = true
	game.StarterGui.EndGui.Message.Visible = true
	game.StarterGui.EndGui.Message.Text = "Hey Can we go on land?"
	game.StarterGui.EndGui.Message.Text = "NO"
	game.StarterGui.EndGui.Message.Text = "why?"
	game.StarterGui.EndGui.Message.Text = "THE SUN IS A DEADLY LASER"
	game.StarterGui.EndGui.Whitee.Visible = true
end)

im also a beginner scripter

1 comment

0

it does anything?

1 answer

✓ Accepted answer

Roblox reads scripts as me, very, very fast, try to give it a delay. Also try to pcall it, pcalling tests the script if there is a error and prints it to the output, as long as you do it like me.

local s,e = pcall(function()
script.Parent.ClickDetector.MouseClick:Connect(function()
    wait(1)
    print ("TheSunIsADeadlyLaser") 
    game.Lighting.Sky.CelestialBodiesShown = true
    game.Lighting.SunRays.Enabled = true
    game.StarterGui.EndGui.Message.Visible = true
   wait()
    game.StarterGui.EndGui.Message.Text = "Hey Can we goona on land?"
    wait(3)
    game.StarterGui.EndGui.Message.Text = "NO"
    wait(2)
    game.StarterGui.EndGui.Message.Text = "why?"
    wait(2)
    game.StarterGui.EndGui.Message.Text = "THE SUN IS A DEADLY LASER"
    wait(4)
    game.StarterGui.EndGui.Whitee.Visible = true
end)
end) if not s == true then warn(e) end

I hope i was able to help! Good day!

1 comment

0

thanks! it worked

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