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

Gui button will not give me tool in surface gui but on screen gui?

Asked by 6 years ago

This button gives a tool on click, but only works when in side a screen gui. It wont even select when placed in a surface gui, what is happening? I do not think you need the script but the problem might be in the script.

you=script.Parent.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:connect(function()
if script.Parent.Selected==false then
if game.Lighting:findFirstChild("Tool") then
Tool=game.Lighting.Tool:clone()
Tool.Parent=you.Backpack
script.Parent.Selected=false
wait(2)
script.Parent.Selected=true
end
end
end)

1 answer

Log in to vote
0
Answered by 6 years ago

I found the problem, i would explain but this link does that better.

https://scriptinghelpers.org/questions/35035/surface-gui-cant-be-clicked

Ad

Answer this question