Idea Print every time the player clicks this tool.
Problem Nothing Is happening (Local Script)
Code:
------Variables------ plr = game.Players.LocalPlayer char = plr.Character tool = script.Parent ------Variables 2------ reloading = false mouse = nil ammo = 5 ------Functions------ function Reload() print"Reload" end ----------------- function Shoot() print"Shoot" ammo = ammo -1 end ------------------- function Splatter() print"Splatter" end ------------------- tool.Activated:connect(function(mse) mouse = mse Shoot() end)
First of all, when you start a localscript with defining LocalPlayer and Character, you need to make the script wait until both of these exist. Sometimes local scripts execute before these both exist. To fix this, use the following code:
repeat wait() until game.Players.LocalPlayer; -- Wait until LocalPlayer exists plr = game.Players.LocalPlayer char = plr:WaitForChild("Character") -- Wait until Character exists
Also, it looks like you are trying to get the mouse. To do so, you can use GetMouse(), which is a function of Player. GetMouse()
returns PlayerMouse. Click the link to view the properties and events of PlayerMouse.