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.
1 | while true do |
2 | wait( 0.1 ) |
3 | function onTouched(Part) |
4 | game.StarterGui.cool.Disabled = true |
5 | end |
6 | end |
Thanks
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:
1 | 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.
1 | local function myFunction() |
2 | return 'hi' |
3 | end ; |
4 |
5 |
6 | local MyVariable = myFunction(); |
7 | print (myFunction) --hi |