You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
-
What is the issue? Include screenshots / videos if possible!
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- This is an example Lua code block
Hi, i need to add creator tag in this script, but i dont know how.
local rs = game:GetService (“ReplicatedStorage”)
local debris = game: GetService (“Debris”)
local remote = rs.AOERemote
function TagHumanoid(humanoid, player)
local Creator_Tag = Instance.new(“ObjectValue”)
Creator_Tag.Name = “creator”
Creator_Tag.Value = player
debris:AddItem(Creator_Tag, 2)
Creator_Tag.Parent = humanoid
end
function UntagHumanoid(humanoid)
for i, v in pairs(humanoid:GetChildren()) do
if v:IsA(“ObjectValue”) and v.Name == “creator” then
v:Destroy()
end
end
end
remote.OnServerEvent:Connect(function (player,data)
if data.action == “Release” then
if data.character.HumanoidRootPart:FindFirstChild("ChargeAttach") then
data.character.HumanoidRootPart:FindFirstChild("ChargeAttach"):Destroy()
end
local hb = Instance.new("Part", workspace.Fx)
hb.Anchored = true
hb.CanCollide = false
hb.Transparency = 1
hb.Name = "hb"
hb.Material = Enum.Material.ForceField
hb.CanQuery = false
hb.Size = Vector3.new(40, 40, 40) * data.charge
hb.CFrame = data.cframe
local con
con = hb.Touched:Connect(function()
con: Disconnect()
end)
local hits = {}
for i,v in pairs (hb:GetTouchingParts()) do
if v.Parent: FindFirstChild ("Humanoid") and (v. Position - data.cframe.Position).Magnitude <= 20 * data.charge then
if v.Parent ~= data.character and hits[v. Parent] == nil then
hits [v. Parent] = true
v.Parent.Humanoid:TakeDamage(50 * data.charge)
local bv = Instance.new("BodyVelocity", v.Parent.HumanoidRootPart)
bv.MaxForce = Vector3.one * 999999
bv.Velocity = (v.Position - data.cframe.Position).Unit * 80 * data.charge + Vector3.new(0, 20, 0)
bv.Name = "vel"
debris:AddItem(bv, .2)
end
end
end
for i, plr in pairs(game.Players:GetChildren()) do
if plr ~= player then
remote:FireClient(plr, data)
end
end
hb:Destroy()
hits = nil
elseif data.action == "Charge" then
local par = rs.Fx.Charge:Clone()
local attach = Instance.new("Attachment", data.character.HumanoidRootPart)
par.Parent = attach
end
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.