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

I can't check if an int value is 1 in the workspace, any clues?

I'm very new to scripting and i can't figure out how to detect if an int value is 1. I don't see what is wrong with this script

if game.Workspace.Value1.Value == 1 then
		game.Workspace.Sound4.Playing = true
		
	end

1 answer

✓ Accepted answer

Two things;

You play a sound with Sound:Play()

You should use game.Workspace:WaitForChild("Value1")

--Variables--
local value = game.Workspace:WaitForChild("Value1") --Pauses the script until Value1 loads in
local sound = game.Workspace:WaitForChild("Sound4") --Does the same for Sound4

if game.Workspace.Value1.Value == 1 then
    sound:Play()
end

p.s: You can use the keyword workspace when referring to game.Workspace in a script!

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