Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

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

Asked by 2 days ago
Edited 2 days ago

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

0
it does anything? TheEagle722 99 — 2d

1 answer

Log in to vote
0
Answered by 2 days ago
Edited 2 days ago

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!

0
thanks! it worked NexterDev 9 — 2d
Ad

Answer this question