Hello, I am working on a script that would allow the owner of a game say a in-game message and it will change the stats of the tycoons. It is a game owner command. Anyways this is what I got so far and it is not working.
a = game.Workspace["berezaa's Tycoon Kit"] Users = {"CallMeDonaldTrump", "NameHere"} player=game.Players.LocalPlayer player.Chatted:connect(function(msg) if msg=="Owner" and player.Name==Users then a["Bright red"].Cash.Value = 999999999 a["Bright green"].Cash.Value = 999999999 a["Bright blue"].Cash.Value = 999999999 a["Bright yellow"].Cash.Value = 999999999 end end)
It is best recommended to learn scripting and not work off of a model you found online. You could get infected or get a while true do end
(A sample loop that can break your game.).
One resource is here: https://developer.roblox.com/
Now, On line 5, you compared a string value with a table value full of strings. Of course, Names can't be tables.
If you want to check if a value given is in a table, there would be multiple options, but the main thing is that most would use a for loop. A for loop runs for a specific amount, be numbers or the amount in a list (or table). My version
function checkvalue(table1,val) for _,v in pairs(table1) do if v==val then return v end end return false end if checkvalue(table1,val) then print(checkvalue(table1,val)) else print('Can not find value.') end