Roblox Scripting Tutorial: Open/Close Door GUI (FilteringEnabled)
Don't forget to add a Remote Event called OpenCloseDoor to the ReplicatedStorage!
Workspace Script:
local replicatedStorage = game:GetService("ReplicatedStorage")
local doorEvent = replicatedStorage:FindFirstChild("OpenCloseDoor")
local door = script.Parent
doorEvent.OnServerEvent:connect(function(player, button)
if button == "open" then
door.Transparency = 0.8
door.CanCollide = false
else
door.Transparency = 0
door.CanCollide = true
end
end)
Open/Close Button Script:
local replicatedStorage = game:GetService("ReplicatedStorage")
local doorEvent = replicatedStorage:FindFirstChild("OpenCloseDoor")
script.Parent.MouseButton1Down:connect(function()
doorEvent:FireServer("open") -- Change this to "close" in the close button.
end)
Be sure to follow me on Twitter after subscribing!
https://twitter.com/Rrrrry123
Also, follow me on Twitch for some live streams!
http://www.twitch.tv/Rrrrry123
Other Videos By RyGuyGaming
Other Statistics
Roblox Statistics For RyGuyGaming
At present, RyGuyGaming has 459,946 views spread across 106 videos for Roblox, and roughly a days worth of Roblox videos were uploaded to his channel. This makes up 17.76% of the content that RyGuyGaming has uploaded to YouTube.