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

Printing a known value returns Nil?

Asked by
jman116 10
9 years ago

I am making a tycoon, when you touch the gate, the gate puts your name in a string value. this code used to work but errored when i tried to find a player , i changed the code at the bottom, now the top doesn't work

mparent = script.Parent.Parent.Parent
Gamer = mparent.Player
print(Gamer.Value)
db = false
cost = 189
function onTouch(hit)
    print("hited")
    print(hit.Parent)
    print(Gamer.Value)

no errors, only says this in output: hited Player1 nil

Answer this question