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

Player A has tool Scissors and can only hurt players with tool Paper?

--Player A has tool Scissors and can only kill players with tool Paper. --Player B has tool Rock and can only kill players with tool Scissors. --Player C has tool paper and can only kill players with tool Rock.

--This would be for player with tool scissors --script would be child of Scissors>Handle

local Handle = script.Parent

local DamageAmount = 100

local function DealDamage(part)

local orb = part.Parent:FindFirstChild("Paper")

local hum = part.Parent:FindFirstChild("Humanoid")

if hum and orb == true then

hum.Health = hum.Health - DamageAmount

end

end

Handle.Touched:Connect(DealDamage)

2 comments

0

lol you might wanna edit this a bit

0

Have you used it yet? If so, Accept answer

1 answer

✓ Accepted answer

A Bit Rushed But, Here Is The Code:

local SP = script.Parent
local plr = game.Players.LocalPlayer
local Char = plr.Character or plr.CharacterAdded:Wait()
local Humanoid = Char:WaitForChild("Humanoid", 2)
local pname = plr.Name
local value = SP.ItemValue
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://04110091372"
local Load = Humanoid:LoadAnimation(Animation)
local equipped = false
local activated = false
local unequipped = true

local pn = {
	['S/P'] = {'Scissor', 'Paper'};
	['P/R'] = {'Paper', 'Rock'};
	['R/S'] = {'Rock', 'Scissor'}	
	}

function Touched(hit)
	local humanoid = hit.Parent:WaitForChild("Humanoid", 1)
		if Char.Name == pname and Humanoid and Equipped and hit.Parent.Name ~= Char.Name then
			wait(1)
			for _,v in pairs(pn) do
				print(v[1])
				if value.Value == v[1] and humanoid then
					local strong = v[2] -- What The Player's Weapons Strong Point Is
					for _,p in pairs(hit.Parent:GetChildren()) do -- Cycle Through Potential Enemy
						if p.Name == strong then
							local en = hit.Parent:WaitForChild("Humanoid", 2)
							en.Health = en.Health - math.random(1,10)
						else
							assert('Cant Attack A Player With: '..p.Name..". You Have: "..value.Value)
							end
						end
				else
					assert('Cant Find: '..value.Value)
					end
				end
		else
			assert('Cant Find Correct Character Or Living Humanoid')
		end
	end

function Equipped()
	equipped = true
end

function Activated()
	Load:Play()
end

function Unequipped()
	equipped = false
end

SP.Activated:Connect(Activated)
SP.Equipped:Connect(Equipped)
SP.Handle.Touched:Connect(Touched)

Hope This Helped!

9 comments

0

Thank you so much for your post! I think I was not clear that PlayerA would have a different tool than Player B. Any chance to take a look at the edited question?

0

So, you need a script to assign different items to individual players?

0

The Local script above can be modified to inflict damage on a player, if thats whay youre asking\

0

Not really..The players already have the items. I just need to make it so Player with scissors can only kill player with paper. And player with paper can only kill player with rock. And player with rock only kill player with scissors

0

Oh, ok.

0

Will post an edited script in a sec

0

Done

0

omg thanks I will check this out as soon as possible, you are amazing for all your help;!

0

Np, make sure, you add a stringvalue in the tool with "Scissor" , "Paper" etc..

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