The code below on line number 7 gives an "attempt to index nil with ‘Name’ error when I collide with the part, which I assume means that the value of player is nil. However printing player.Name directly does not error and does return my player name.
How would I go about fixing that line?
local parent = script.Parent
local function MultiChange(otherPart)
local player = game:GetService("Players"):GetPlayerFromCharacter(otherPart.Parent)
local strengthPlaceMulti = game.ServerStorage.RemoteData[player.Name].StrengthPlaceMulti.Value
print(player.Name)
strengthPlaceMulti = 10
end
parent.Touched:Connect(MultiChange)