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

How do i make a script work for a button on a surface gui text button and not a block for lights?

Asked by 10 years ago

This script is in a block with a "Click Detector" but when i move the script into a text button on a surface gui it wont work... And i cant move the click detector into the text button?

local Epic=script.Parent.ClickDetector function onClick() game.Workspace.Light1.PointLight.Color = Color3.new(255/255,0/255,0/255) game.Workspace.Light2.PointLight.Color = Color3.new(255/255,0/255,0/255) game.Workspace.Light3.PointLight.Color = Color3.new(255/255,0/255,0/255) game.Workspace.Light4.PointLight.Color = Color3.new(255/255,0/255,0/255) end Epic.MouseClick:connect(onClick)

I want that but i want the button to be a text button on surface gui not a block like it currently is.

2 answers

Log in to vote
1
Answered by 10 years ago

So would that be this in full

1Iscript.Parent.MouseButton1Click:connect(function()

2 I game.Workspace.Light1.PointLight.Color = Color3.new(255/255,0/255,0/255) 3 I game.Workspace.Light2.PointLight.Color = Color3.new(255/255,0/255,0/255) 4 I game.Workspace.Light3.PointLight.Color = Color3.new(255/255,0/255,0/255) 5 I game.Workspace.Light4.PointLight.Color = Color3.new(255/255,0/255,0/255) 6 I end)

And ty for helping

Ad
Log in to vote
0
Answered by 10 years ago

Next time, please put your code into Lua syntax. Also, in a TextButton, it would be

--remove "epic"

script.Parent.MouseButton1Click:connect(function()
--insert code here
end)

Answer this question