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

How to make the following script don't do instances with whatever button i click?

local player = game.Players.LocalPlayer

local player = game.Players.LocalPlayer

repeat wait() until player.Character.Humanoid

local humanoid = player.Character.Humanoid

local mouse = player:GetMouse()

local RemoteEvent=game.ReplicatedStorage.Fired

local UIS=game:GetService("UserInputService")

local humanoid = player.Character.Humanoid

local mouse = player:GetMouse()

local anim = Instance.new("Animation")

----------------------------------------------------------------

local RemoteEvent=game.ReplicatedStorage.Fired

local UIS=game:GetService("UserInputService")

local DEbounce=false

----------------------------------------------------------------

UIS.InputBegan:Connect(function(Input)

RemoteEvent:FireServer(DEbounce)

----------------------------------------------------------------

anim.AnimationId = "rbxassetid://1677718651"

  

mouse.KeyDown:connect(function(key)

if key == "r" then

local playAnim = humanoid:LoadAnimation(anim)

playAnim:Play()

end

end)

end)

2 comments

0

Why does this look like a free model script...

0

Can you explain your problem more please? I’m a bit confused. Also why are you defining “player” twice?

1 answer

I fixed it...It was in the wrong line:

local player = game.Players.LocalPlayer

local player = game.Players.LocalPlayer

repeat wait() until player.Character.Humanoid

local humanoid = player.Character.Humanoid

local mouse = player:GetMouse()

local RemoteEvent=game.ReplicatedStorage.Fired

local UIS=game:GetService("UserInputService")

local humanoid = player.Character.Humanoid

local mouse = player:GetMouse()

local anim = Instance.new("Animation")

----------------------------------------------------------------

local RemoteEvent=game.ReplicatedStorage.Fired

local UIS=game:GetService("UserInputService")

local DEbounce=false

----------------------------------------------------------------

  

----------------------------------------------------------------

  

mouse.KeyDown:connect(function(key)

  

  

if key == "r" then

anim.AnimationId = "rbxassetid://1677718651"

RemoteEvent:FireServer(DEbounce)

local playAnim = humanoid:LoadAnimation(anim)

playAnim:Play()

end

end)

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