So, I have a script that uses local player, and a touched function in it. It just flat out doesn't work. I know I can use remote events, but is there a different way to do it? Here's my code. Could there also be a way to access the player, from the character?
script.Parent.Touched:Connect(function(part2)
local Player = game.Players:GetPlayerFromCharacter(part2.Parent) -- Checks and returns if the part associates to a player
if Player then
wait()
print ("Touched")
game.Players.LocalPlayer.Data.PistolAmmo.Value = game.Players.LocalPlayer.Data.PistolAmmo.Value + 5
end
end)

5 comments
Oh, you can? Thank you!
Yup.
Please explain the Code.
Ok.
You didn't have to explain my code, lol. Maybe just explain the GetPlayerFromCharacter.