Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how do i fix this? i tried to make a skill that can get reward

	script.Parent.OnServerEvent:Connect(function(plr)
	wait(0.3)
	local Slash = game.ReplicatedStorage.cutslash:Clone()
	Slash.Parent = workspace
	Slash.CanCollide = false
	Slash.Anchored = true
	Slash.CFrame = plr.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-5) * CFrame.fromEulerAnglesXYZ(0,110,0)
	Slash.Touched:Connect(function(hit, plr)
		if hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Name ~= plr.Name then
			local Ball = game.ReplicatedStorage.redball:Clone()
			local tag = Instance.new('ObjectValue',hit.Parent.Humanoid)
			tag.Name = 'creator'
			tag.Value = [help]
			Ball.Parent = workspace
			Ball.CFrame = Slash.CFrame
			Ball.CanCollide = false
			Ball.Anchored = true
			Slash:Destroy()
			hit.Parent.Humanoid:TakeDamage(25)	
			for i = 1,18 do
				wait(.05)
				Ball.Size = Ball.Size + Vector3.new(0.3,0.3,0.3)
				Ball.Transparency = Ball.Transparency + 0.05
			end	
			wait(2)
			tag:Destroy()
			Ball:Destroy()	
		end
	end)
	Slash.Anchored = false
	local BV = Instance.new("BodyVelocity",Slash)
	BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
	BV.Velocity = plr.Character.HumanoidRootPart.CFrame.lookVector * 150
	wait(5)
	Slash:Destroy()
	wait(0.15)
end)

1 comment

0

Are you trying to have tag.Value = the player using the item?

1 answer

I'm assuming you wish the "creator" tag to be the person holding the item damaging the other player.

tag.Value = plr

This discussion is preserved as it was. New answers, comments, and votes are closed.