Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[SOLVED] i try to change a string value when you touch a part but it does not work?

Asked by 5 years ago
Edited 5 years ago

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)
0
Value.new is not a thing DeceptiveCaster 3761 — 5y
0
it should be oof.Value = police not Value.new DeceptiveCaster 3761 — 5y
0
thanks I'm going to see if it works kipwater -8 — 5y
0
it does not work kipwater -8 — 5y
View all comments (15 more)
0
ok, first of all, what is police? DeceptiveCaster 3761 — 5y
0
if it is on police, an alarm will sound kipwater -8 — 5y
1
that doesn't answer my question, I'm asking what it is not what it does DeceptiveCaster 3761 — 5y
0
normally the value is set to none kipwater -8 — 5y
1
Change police to "police" or 'police'. That turns the text into a string. User#20279 0 — 5y
0
^ DeceptiveCaster 3761 — 5y
0
yes kipwater -8 — 5y
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 DeceptiveCaster 3761 — 5y
0
ok kipwater -8 — 5y
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 kipwater -8 — 5y
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" Miniller 562 — 5y
0
ok kipwater -8 — 5y
0
string variable is e.g local a = "string" Miniller 562 — 5y
0
thank you very much it works kipwater -8 — 5y
0
Edit the question and write [SOLVED] at the beginning of the question. Miniller 562 — 5y

Answer this question