I haven’t used roblox studio in forever due to focusing on python programming. I had an idea for a game but I can’t remember how to find the local player.
This is a code snippet from a sword giver (not working):
sword = game.ReplicatedStorage.ClassicSword
Players = game:GetService("Players")
player = game.Players.LocalPlayer
print(player)
script.Parent.Touched:Connect(function(object)
if object.Parent:FindFirstChild('Humanoid') then
local giveSword = sword:Clone()
giveSword.Parent = player.Backpack
end
end)