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

Why is the script in startergui not disabling?

Im trying to disable a script from the StarterGui (the field of view playbackloudness) with the script of the playbackloudness is notwing wrong because it works fine for me im using a normal script.

while true do
	wait(0.1)
function onTouched(Part)
game.StarterGui.cool.Disabled = true
end
end

Thanks

1 comment

0

StarterGui or PlayerGui?

1 answer

StarterGui is not an active instance. It only duplicates itself into a player's PlayerGui when a player spawns.

Utilize the PlayerGui instead of the StarterGui:

game.Players.LocalPlayer.PlayerGui

Also--I just noticed, you define a function but never call it. Function blocks only run when they are called. Call a function by attaching parenthesis at the end of the name.

local function myFunction()
	return 'hi'
end;


local MyVariable = myFunction();
print(myFunction) --hi

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