Im trying to make a script where if you touch a torso of a player (no humanoid in it), it gives you Rum, but it says "tried to index player, a nil value?"
Script :
local player = game.Players.LocalPlayer
local money = player:WaitForChild("Money")
function onMouseClick(player)
if player.money >= 3 then
local Rum = game.Lighting:FindFirstChild("Rum")
Rum:Clone()
Rum.Parent = player.Backpack
end
end

2 comments
Are you using a localscript?
In the future, please make the title of your question specific to your problem.