Hi! , ill go straight to the point
-
What do you want to achieve? I want to make my own killcam system but i dont know how to add the creator tag to my custom weapons, which i need for the killcam to recognize them
-
What is the issue? look, i made this little client sided script that detects when a player dies and prints a message if it got killed by someone
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
yeah but i didnt find any forums with a problem similar to mine, i also tried fixing the issue by myself, creating the tag on the explorer and then assigning its value via script but that didnt work, i didnt really know what i was doing tbh
ive read that that creator tag stuff should be dealth in scripts with the damage handling and stuff, i dont know if this really helps but ill heave the damage handling script here anyway
local RS = game:GetService("ReplicatedStorage")
local onHitevent = script.Parent.HitboxNDamage
onHitevent.OnServerEvent:Connect(function(plr, hitHum)
if not hitHum then return end
local hitSound = RS.Weapons.MetalBat.BatHitSound:Clone()
hitSound.Parent = hitHum.Parent
hitSound:Play()
local RandomCritChance = math.random()
if RandomCritChance > 0.12 then
hitHum:TakeDamage(10)
else
local CritSound = RS.Weapons.MetalBat.BatCritSound:Clone()
local CritParticle = RS.Weapons.MetalBat.CritHitParticle:Clone()
CritSound.Parent = hitHum.Parent
CritSound:Play()
CritParticle.Parent = game.Workspace
CritParticle.Position = hitHum.Parent.Head.Position
hitHum:TakeDamage(30)
end
local knockback = Instance.new("BodyVelocity")
knockback.P = math.huge
knockback.Parent = hitHum.Parent.HumanoidRootPart
knockback.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
knockback.Velocity = plr.Character.HumanoidRootPart.CFrame.LookVector * 12
wait(0.2)
knockback:Destroy()
end)