Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

PlayerGui Script Wont Enable Screen GUI?

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

local compvalue = workspace.Value:FindFirstChild('Completed')

script.Parent.Parent.Enabled = false

compvalue.Changed:Connect(function()
	if compvalue.Value == true then
		script.Parent.Parent.Enabled = true
		task.wait(1)
		script.Parent.Image = "rbxassetid://12853392069"
		task.wait(3)
		script.Parent.Image = "rbxassetid://12853395602"
		task.wait(.5)
		script.Parent.Image = "rbxassetid://12853406732"
		task.wait(.5)
		script.Parent.Image = "rbxassetid://12853440018"
		task.wait(3.9)
		script.Parent.Image = "rbxassetid://12853464935"
		task.wait(4.55)
		script.Parent.Image = "rbxassetid://12853475748"
		task.wait(4.65)
		script.Parent.Image = "rbxassetid://12853487139"
		task.wait(1.15)
		script.Parent.Image = "rbxassetid://12853489766"
		task.wait(3)
		script.Parent.Image = "rbxassetid://12853499912"
		task.wait(4.65)
		script.Parent.Image = "rbxassetid://12853510345"
		task.wait(.5)
		script.Parent.Image = "rbxassetid://12853516984"
		task.wait(1)
		script.Parent.Parent:Destroy()
	end
end)



1 answer

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:

local value = game.Workspace.HelloValue

value:GetPropertyChangedSignal("Value"):Connect(function(newValue) -- The first argument in the function() method is the new value
	print(newValue) -- Prints out the new value
end)

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

This discussion is preserved as it was. New answers, comments, and votes are closed.