I've looked and looked in the wiki but can't seem to fix my problem.
Output gives me "Players.Player1.PlayerGui.Jump:17: attempt to index global 'mouse' (a nil value)"
This is in a local script.
----------------
local Player = Game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local function onKeyDown()
local player = script.Parent.Parent.Character
if (OnKeyDown:lower() == "32") then
player.Humanoid.WalkSpeed = player.Humanoid.WalkSpeed + 5
wait(0.2)
repeat
wait()
until player.Humanoid.Jump == false
player.Humanoid.Walkspeed = 24
end
end
Mouse.KeyDown:connect(onKeyDown) |