Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

PlayerGui Script Wont Enable Screen GUI?

Asked by 2 years ago

This script is supposed to do that when it detects that the BoolValue equals True, then the image will change after waiting and then will delete it from PlayerGui after. Still, for some reason, the image won't change, I checked the dev panel and it doesn't come up with anything if anyone can help I would appreciate it!

note: the ZIndex for the ImageLabel (AKA The parent of this script) is higher than all other GUI objects

(sorry if i didn't explain it well)

Legacy Script

01local compvalue = workspace.Value:FindFirstChild('Completed')
02 
03script.Parent.Parent.Enabled = false
04 
05compvalue.Changed:Connect(function()
06    if compvalue.Value == true then
07        script.Parent.Parent.Enabled = true
08        task.wait(1)
09        script.Parent.Image = "rbxassetid://12853392069"
10        task.wait(3)
11        script.Parent.Image = "rbxassetid://12853395602"
12        task.wait(.5)
13        script.Parent.Image = "rbxassetid://12853406732"
14        task.wait(.5)
15        script.Parent.Image = "rbxassetid://12853440018"
View all 33 lines...

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

What type of script are you using to change the value and change the image? If the value is changed from client or server and the script inside the image is the opposite, this won't detect value changes: client doesn't replicate on server, but server does replicate on client (i guess).

If this is the problem, use remotes to check the value and then fire the remote so the another script can change the image.

Also, it's better to use compvalue:GetPropertyChangedSignal("Value") so it will detect only if the value changes and not any other property.

Example:

1local value = game.Workspace.HelloValue
2 
3value:GetPropertyChangedSignal("Value"):Connect(function(newValue) -- The first argument in the function() method is the new value
4    print(newValue) -- Prints out the new value
5end)

Though, GUI object properties can only be changed by client. Some of them can be maybe changed by server, but not all.

Ad

Answer this question