Heya, it's me and my dumb buttons again.
So since last time I managed to make client sided buttons that activated on every child that can be activated by an event.
I have two buttons - one that fires a good quality (making the platform visible) and one that fires a bad quality (making the platform non-collidable)
My script for each in SeverScriptStorage is as shown
local ButtonPlatform = workspace.Button.ButtonPlatforms
local ButtonPressed = false
game.ReplicatedStorage.PropertyChangeGood.OnClientEvent:Connect(function()
if not ButtonPressed then
ButtonPressed = true
for i, v in pairs (ButtonPlatform:GetChildren()) do
v.Transparency = 0
v.CanCollide = true
game.Players.LocalPlayer.PlayerScripts.SuccessSound:Play()
ButtonPressed = false
end end end)
and
local ButtonPlatform = workspace.Button.ButtonPlatforms
local ButtonPressed = false
game.ReplicatedStorage.PropertyChangeBad.OnClientEvent:Connect(function()
if not ButtonPressed then
ButtonPressed = true
for i, v in pairs (ButtonPlatform:GetChildren()) do
v.Transparency = 0.5
v.CanCollide = false
ButtonPressed = false
end end end)
this script works perfectly as intended, however if one stays standing on the block that fires the PropertyChangeGood, the sound plays over and over again and lags out the player (whilst also creating a abnormally loud environment.)
I was wondering if there was a way to only be able to active PropertyChangeGood if PropertyChangeBad has been fired before it? So if PropetyChangeGood were to be activated it would only work if PropertyChangeBad was true at the current time.
(Also ignore the irrelevant debouncer in the script, it doesn't do anything bad or good and I'm too lazy to get rid of it)
Thanks again hehe

1 comment
damn dude you are so helpful, youve literally commented on every single one of my posts now. you really are the best. ill check this out when i get home from school today. you rock!!