Script Not Activating Another Properly

So I am currently trying to make a scene where after closing the gui of reading a note, the fireplace goes out and plays some sounds. But I noticed that when the script activates the other script, it does work in the test run, but not in the current client.

–[[

flashes sometimes on open
don’t make close button disappear

fix/change repulsion block (use GettingUp too)

–]]

g = script.Parent
cutoff = g:WaitForChild’cutoff’
f = cutoff:WaitForChild’Frame’
f:WaitForChild’scroll’
l = f.scroll:WaitForChild’TextLabel’
f:WaitForChild’buttons’
close = f.buttons:WaitForChild’close’

cutoff_start = 128
cutoff_end = 562
originalpos = cutoff.Position

–l.WordWrap = word_wrap

closing=false
close.MouseButton1Click:connect(function()
–close.Visible = false

hidef()
closing=true
–cutoff.Visible = false

end)

function showf()
script.scrollunroll.Pitch = math.random(900,1100)/1000
script.scrollunroll:Play()
close.Visible = true

cutoff.Visible = false
cutoff.Position = UDim2.new(0.5,-300,0,-300)
cutoff.Visible = true
cutoff:TweenPosition(
originalpos
, “In”, “Quad”, .5, true, nil
)
wait(.51)
cutoff.Size = UDim2.new(0,600,0,cutoff_start)
–cutoff.Visible = true
cutoff:TweenSize(
UDim2.new(0,600,0,cutoff_end)
, “Out”, “Quad”, .8, true, nil
)
end

function hidef()
if closing then return end
script.scrollroll.Pitch = math.random(900,1100)/1000
script.scrollroll:Play()
cutoff:TweenSize(
UDim2.new(0,600,0,cutoff_start)
, “Out”, “Quad”, .3, true, nil
)
wait(.31)
cutoff:TweenPosition(
UDim2.new(0.5,-300,0,-300)
, “Out”, “Quad”, .3, true, nil
)
wait(.31)
game.Workspace.FireOut.Disabled = false
script.Parent.Parent.Shine.Disabled = true
script.Parent.Parent.Decal.Transparency = (0)
cutoff.Visible = false
–cutoff.Position = originalpos
g:Destroy()
end

–l.Text = text
showf()

By the way, yes this is a free model, but I’m new to scripting so I’m trying pre-made stuff.

game.Workspace.Realisticfire.Bottom.Enabled = false

game.Workspace.Realisticfire.Top.Enabled = false

game.Workspace.FireLight.PointLight.Brightness = (0)

game.Workspace.FireCrackle.SFX.Volume = 0

script.Spook:Play()

wait(8)

script.Thump:Play()

This is the script that disables the firelight and plays some sounds.

This video shows the problem. Also, I just put the paper outside to test around with it, and there is a constant glow on the piece of paper to show the player needs to touch it.

[DevForum Didn’t Process Video, Video In Replies]


This how it is suppose to work.

I’m new to scripting, so tell me if there is an easy fix.

It wouldn’t load so I had to cut it in half


Not sure how you’re handling this, but a localscript cannot make server-sided changes. (I assume closing the GUI is handled by a localscript). Search up remoteevents and remotefunctions (remoteevents are more appropriate for this case).

I am not using a local script, and the first time I tried making this work with remove events nothing happened. Is there anything wrong with something I defined or what?

You have to use a localscript. Server(normal) scripts can’t detect client gui changes.

As I stated above, I am using a free model which does work with the server script. I will try and see if a local script does work.

You have to use a localscript in GUI then a remoteevent which fires an event received by the script. Search up remoteevent.

Sorry the script was local my computer’s resolution made it look like a normal script. But I don’t have a remote event, is that a problem?

Read what I said:

You must do it this way (that’s how FilteringEnabled works).

Then how did the script work when it was not edited?

Maybe you had FilteringEnabled off or you didn’t check properly? I don’t know but in any case, you need to use remotes in FilteringEnabled games.

How would I set up the remote?

It’s hard to help you when you ignore half of what I’m saying. I told you to search it up (you should be trying stuff on your own before asking for help; I can tell you have not looked at the wiki yet. Custom Events and Callbacks | Documentation - Roblox Creator Hub