of     1   

Craftero
#182989659Thursday, February 04, 2016 5:29 PM GMT

I'm trying to add points to a DataStore when a Player touches a certain Part. The problem I'm having is that I cannot get the UserId of the Player in order to assign the id as the key of the DataStore. Does anybody know how I can get the user's id? Is there an alternative technique I should be using? Any help or advise would be greatly appreciated.
jumpykilldestroy
#182989703Thursday, February 04, 2016 5:30 PM GMT

Part.Touched:connect(function(Hit) local Player=game:service'Players':GetPlayerFromCharacter(Hit.Parent) if Player==nil then return nil end local UserId=Player.UserId --do the rest of things end)
Aovis
#182989824Thursday, February 04, 2016 5:34 PM GMT

Or just use HTTP Service and get it when they join? 1000x easier
Craftero
#182989933Thursday, February 04, 2016 5:38 PM GMT

@Bernkastel2727 What do you mean? I'm using this for coins which are cloned from ReplicatedStorage. Do you mean placing an intValue with the user's id into the Player's Model or something? As you can probably tell, I'm new to DataStores and I would appreciate any help and advise .
OzzyFin
#182990619Thursday, February 04, 2016 6:01 PM GMT

"Or just use HTTP Service and get it when they join? 1000x" that's just stupid and makes no sense use UserId property of player like shown above

    of     1