I'm trying to make a berry that when you eat it, gives the person who ate it 45 Mana. However, the script in my tool will not recognize when it activates/the tool isnt activating at all! Also, there's no output errors. Can someone help me? Code:
local Tool = script.Parent local player = game.Players.LocalPlayer mouse = game.Players.LocalPlayer:GetMouse() nomore = false function onActivated() print("activated") if nomore == false then print("eating berry") nomore =true script.EatSound:Play() Tool.GripForward = Vector3.new(0,0,-1) Tool.GripPos = Vector3.new(1.392,-0.663,-0693) Tool.GripRight = Vector3.new(1,0,0) Tool.GripUp = Vector3.new(0,1,0) wait(2) print("Mana Up!") pxp = player.leaderstats.Mana.Value player.leaderstats.Mana.Value = pxp + 45 script.Parent:Destroy() end end Tool.Activated:connect(onActivated) -- Doesn't work at all?! WHAT?! --Keep in mind this is in a LocalScript.. Regular scripts couldn't even work.
it shouldnt be Activated try using OnEquipped