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

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

Asked by 4 years ago
Edited 4 years 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 170 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years 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 13 — 4y
Ad

Answer this question