I need help with a script, so I need to make a tool that kills you on clicking can anyone help me on that? I'm trying to add it to this :
local Tool = script.Parent
enabled = true
function onActivated()
if not enabled then
return
end
enabled = false
Tool.GripForward = Vector3.new(-.981, .196, 0)
Tool.GripPos = Vector3.new(-.5, -0.6, -1.5)
Tool.GripRight = Vector3.new(0, -0, -1)
Tool.GripUp = Vector3.new(0.196, .981, 0)
Tool.Handle.EatSound:Play()
wait(.8)
local h = Tool.Parent:FindFirstChild("Humanoid")
if (h ~= nil) then
if (h.MaxHealth > h.Health + 1.6) then
h.Health = h.Health - 1.6
else
h.Health = h.MaxHealth
end
end
Tool.GripForward = Vector3.new(-1, 0, 0)
Tool.GripPos = Vector3.new(-.5, -.1, 0)
Tool.GripRight = Vector3.new(0, 0, 1)
Tool.GripUp = Vector3.new(0,1,0)
enabled = true
end
function onEquipped()
Tool.Handle.OpenSound:play()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
####[Edit by JesseSong:] Ensure you've formated your code properly by using a code block, make sure you matain your code between the lines i.e.
Your code
Also make sure you give us sufficient information to answer your question correctly. You can read this documentation by clicking on the hyperlink provided to set up a good question/answer indispensably
Also, do not put random information on the title for example( eeeeeeeeeeee) etc.
Last tip: Make sure you give us more information for us to answer your question. Simply saying "I need help" is not enough information for the community to answer your question!
Good information include: A vast description of your perception, error codes (If applicable) snippets, cross - checking (that is ways in which you've tried that failed to work) etc.
##Also, always do your research before posting questions, as answers may have been answered effectively.
Thank you, JesseSong

3 comments
Format pls
eeeeeeeeeee
Can you explain your script above?, What are you trying to do with your weapon? Reduce the player's health??