Help Me With Value

help Why Its Not Working

-- local var = game.Workspace.click.Script.Value.Value
if var == 1 then
	script.Parent.Text = "Green Baseplate?"
end

please provide more detail on how it is not working. The snippet u provided seems to be fine

1 Like

its not working its not fine i check its my error?

Your if statement will not work if var is under or above 1

You need to provide more information.

Based on the extremely limited information you are providing, I assume that you want it to update whenever the value is changed?

This code should do that:

local Holder = game.Workspace.click.Script.Value

Holder.Changed:Connect(function()
    if Holder.Value == 1 then
        script.Parent.Text = "Green Baseplate?"
    end
end)
1 Like

If you change:
-- local var = game.Workspace.click.Script.Value.Value
To:

local var = game.Workspace.click.Script.Value.Value

It should work unless you’re using a LocalScript, then you’ll need:

local var = game.Workspace:WaitForChild"click":WaitForChild"Script":WaitForChild"Value".Value

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.