This is my script and for some reason idk why it doesn't work. ( btw its for a text button, and dont question the "Nights" )
game.StarterGui.Nights.Night1.MouseButton1Down:Connect(Night1)
This is my script and for some reason idk why it doesn't work. ( btw its for a text button, and dont question the "Nights" )
game.StarterGui.Nights.Night1.MouseButton1Down:Connect(Night1)
So I think this would help. Put a local script in your button, and write this code.
local shopframe = script.Parent.Parent.ShopFrame
script.Parent.MouseButton1Click:Connect(function()
--your code here
--If you are making a shop, make the frame visible.
if shopframe.Visible == false then
shopframe.Visible = true
elseif shopframe.Visible == true then
shopframe.Visible = false
end --This will make it so you can click to close it and open it.
end)
Now if you wanna fire a remote event, you would access the place where you put your remote event:
local re = game.ReplicatedStorage.RemoteEvent
script.Parent.MouseButton1Click:Connect(function(Night1)
re:FireServer()
end)
Then you would make a script inside ServerScriptService.
local re = game.ReplicatedStorage.RemoteEvent
re.OnServerEvent:Connect(function()
--code here
end)
If theres anything else, ask right away.
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
And the "Nights" after StarterGui is a renamed screen GUI if thats helpful
Check this answer https://scriptinghelpers.org/questions/95072/how-to-make-children-of-screengui-available-for-playergui#87825
ahhhh ok thank you