Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago
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)
0
Why does this look like a free model script... DeceptiveCaster 3761 — 5y
0
Can you explain your problem more please? I’m a bit confused. Also why are you defining “player” twice? User#20279 0 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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)
Ad

Answer this question