can’t figure out how to give players kills when they kill somebody
here is a video of the game so far
here is script in the tool
local descendants = game.Workspace:GetDescendants()
for i, v in pairs(descendants) do
if v:IsA("Part") then
if v.Name == "DynaPart" then
local dpart = v
print(dpart.Name)
local plrsname = dpart.PLRSNAME.Value
-- need help here cant figure out how to give the player kills from here
end
end
end
Assuming this is the correct name, all you’d need to do is:
local Players = game:GetService("Players")
local Player = Players:FindFirstChild(plrsname)
And since I’m assuming that this part is not being cloned (a new one is being added each time), this line will not have the new parts since you’re calling this function one time and just assigning it to a variable.
If you want it to get all of the current parts and other instances you’ll have to call GetDescendants each time.
But I’d advise against the above since GetDescendants is not very performant.
You should strive to put the DynaPart in a separate Folder or not keeping it within a child of workspace that way you can just call workspace:FindFirstChild("DynaPart") or workspace.DynaPart