-
What do you want to achieve? Keep it simple and clear!
Have it so when I click once on a certain tool it fires an event, twice for a different one. ONLY for a specific tool. -
What is the issue? Include screenshots / videos if possible!
The script is firing the events even though the specific tool that contains the script is not being clicked on. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve looked on the Devforum and haven’t find any cases related to mine, and google hasn’t shown me much.
The events fired brings a model out of server storage and puts it in the place of where the player who clicked the tool is along with other things. However they don’t interfere with the local script.
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Clicks = 0
script.Parent.Equipped:Connect(function(b)
Mouse.Button1Down:Connect(function()
animation =game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
Clicks = Clicks + 1
if Clicks == 1 then
animation:Play()
game.ReplicatedStorage.Teleport1:FireServer(b)
wait(3)
animation:Stop()
end
if Clicks == 2 then
game.ReplicatedStorage.Teleport2:FireServer(b)
Clicks = 0
end
end)
end)
script.Parent.Unequipped:Connect(function()
animation:Stop()
end)