I am fairly new to Roblox Studio, I just started making a new script for a screen gui that when it is clicked it will do something, this is it:
(Parent is a Text Button in this case)
*script.Parent.MouseButton1Click:Connect(function()
game.Workspace.Baseplate.Transparency = 1
end)*
It had worked for me many times before, but recently it has not worked. After a while of messing around with literally everything i could find, I just can't tell if i have done something wrong or if there was something changed.
The reason you're not seeing anything happen is because you created the code in a Script instead of a LocalScript. Try doing that first. (If I got this wrong, you can skip this part.)
With the LocalScript code, the baseplate will only turn invisible for the player clicking the button in the GUI at that time. If that is your intended effect, you can stop there. However, if you want this to be replicated, I think this ROBLOX Wiki article about remote functions and events will help you make it invisible for the entire server.
After reading the article, we can try this with both the LocalScript from the GUI and a Script communicating via a RemoteEvent:
--------------------------------- -- In GUI (LocalScript): -- --------------------------------- local event = game.ReplicatedStorage:WaitForChild("InvisibleBaseplate") -- Replace the name in quotes with the name of the event made by the script. script.Parent.MouseButton1Click:Connect(function() event:FireServer() end) --------------------------------- -- Server (Script) -- --------------------------------- event = Instance.new("ReplicatedStorage") event.Name = "InvisibleBaseplate" event.Parent = game.ReplicatedStorage event.OnServerEvent:Connect(function(player) print("baseplate made invisible by "..player.Name) game.Workspace.Baseplate.Transparency = 1 end)
If this answer helped you, you can click the Accept button. If I made a mistake in any part of this or you have a question about this, you can make a comment on my answer by looking at the box below.