I'm working on a game, but I need something to change a string value when you touch a part I've tried many times, but it does not work here is my script:

oof = game.ReplicatedStorage.Markers.Bank.Config.BurstType

script.Parent.Touched:Connect(function()
	oof.Value.new = police
end)

19 comments

0

Value.new is not a thing

0

it should be oof.Value = police not Value.new

0

thanks I'm going to see if it works

0

it does not work

0

ok, first of all, what is police?

0

if it is on police, an alarm will sound

1

that doesn't answer my question, I'm asking what it is not what it does

0

normally the value is set to none

1

Change police to "police" or 'police'. That turns the text into a string.

0

^

0

yes

0

if police wasn't a string then you would be getting an error about assigning nil to a string value, the value being oof.Value

0

ok

0

It does not matter to me anymore that there is something wrong with the police. I just want the value to change when I touch a part

0

if police is not a variable, and if it is, if it's not a string variable, you should use what others said: oof.Value = "police"

0

ok

0

string variable is e.g local a = "string"

0

thank you very much it works

0

Edit the question and write [SOLVED] at the beginning of the question.