Quick help with script

Just a bit confused
Im using Lootplan and all i need help with is defining “player”
here’s the script

local LootPlan = require(game.ReplicatedStorage.LootPlan)

local DropPlan = LootPlan.new(“single”)

DropPlan:AddLoot(“Apple of Healing”,100)

DropPlan:AddLoot(“Nothing”,0)

local DropType = DropPlan:GetRandomLoot()

DropType:Clone().Parent = player.Backpack

is this on a server script or client script?

if its on client:

  • easy: just do game.Players.LocalPlayer to get the player

if its on server:

game.Players.PlayerAdded:Connect(function(player) 
    -- whatever code you have
end)

@theepicgdog i should have said I’m using this script for when a player kills an NPC would this still work?

The script is in the NPC if that helps

no, not really. is the script a local script or a normal script?

The script is normal (im witing this part bc it needs more characters)

ok, then its a server script, meaning you have to use the server solution.

Okay, thank you so much for your help