FauxHawkeJoin Date: 2012-06-08 Post Count: 2190 |
I'm trying to make it so when you scroll, it changes what tool you have selected.
game.StarterGui:SetCoreGuiEnabled("Backpack", false)
player = script.Parent.Parent
mouse = player:GetMouse()
player.CameraMaxZoomDistance = 50
player.CameraMinZoomDistance = 50
mouse.WheelForward:connect(function()
--what would i put here
end)
mouse.WheelBackward:connect(function()
--what would i put here
end)
Any ideas? |
|
smiley599Join Date: 2010-01-23 Post Count: 21869 |
aha i made that 2 days ago so i do have ideas |
|
FauxHawkeJoin Date: 2012-06-08 Post Count: 2190 |
Can..a...you help me maybe? |
|
smiley599Join Date: 2010-01-23 Post Count: 21869 |
what is wrong with your fps
it took 2 mins to load character and now its saying loading client
da hel |
|
FauxHawkeJoin Date: 2012-06-08 Post Count: 2190 |
I'm fixing it, now can you help me? |
|
FauxHawkeJoin Date: 2012-06-08 Post Count: 2190 |
Can anyone help me at all? |
|
FauxHawkeJoin Date: 2012-06-08 Post Count: 2190 |
B1 |
|
FauxHawkeJoin Date: 2012-06-08 Post Count: 2190 |
b2 |
|
Bebee2Join Date: 2009-05-17 Post Count: 3985 |
-- Something like this...
game.StarterGui:SetCoreGuiEnabled("Backpack", false)
player = script.Parent.Parent
mouse = player:GetMouse()
player.CameraMaxZoomDistance = 50
player.CameraMinZoomDistance = 50
local i = 1
mouse.WheelForward:connect(function()
if #player.Backpack:children()[i-1] and i > 1 then
player.Character.Humanoid:UnequipTools()
local tool = player.Backpack:children()[i]
player.Character.Humanoid:EquipTool(tool)
i = i + 1
elseif i == 1 then
i = #player.Backpack:children()
player.Character.Humanoid:UnequipTools()
local tool = player.Backpack:children()[i]
player.Character.Humanoid:EquipTool(tool)
else
i = #player.Backpack:children()
end
end)
mouse.WheelBackward:connect(function()
if #player.Backpack:children()[i+1] then
player.Character.Humanoid:UnequipTools()
local tool = player.Backpack:children()[i]
player.Character.Humanoid:EquipTool(tool)
i = i + 1
elseif #player.Backpack:children() < i then
i = 1
player.Character.Humanoid:UnequipTools()
local tool = player.Backpack:children()[i]
player.Character.Humanoid:EquipTool(tool)
else
i = 1
end
end) |
|
FauxHawkeJoin Date: 2012-06-08 Post Count: 2190 |
Players.Player1.Backpack.Test:8: attempt to get length of field '?' (a nil value)
Players.Player1.Backpack.Test:23: attempt to get length of field '?' (a userdata value) |
|
Bebee2Join Date: 2009-05-17 Post Count: 3985 |
-- My bad
game.StarterGui:SetCoreGuiEnabled("Backpack", false)
player = script.Parent.Parent
mouse = player:GetMouse()
player.CameraMaxZoomDistance = 50
player.CameraMinZoomDistance = 50
local i = 1
mouse.WheelForward:connect(function()
if player.Backpack:children()[i-1] and i > 1 then
player.Character.Humanoid:UnequipTools()
local tool = player.Backpack:children()[i]
player.Character.Humanoid:EquipTool(tool)
i = i + 1
elseif i == 1 then
i = #player.Backpack:children()
player.Character.Humanoid:UnequipTools()
local tool = player.Backpack:children()[i]
player.Character.Humanoid:EquipTool(tool)
else
i = #player.Backpack:children()
end
end)
mouse.WheelBackward:connect(function()
if player.Backpack:children()[i+1] then
player.Character.Humanoid:UnequipTools()
local tool = player.Backpack:children()[i]
player.Character.Humanoid:EquipTool(tool)
i = i + 1
elseif #player.Backpack:children() < i then
i = 1
player.Character.Humanoid:UnequipTools()
local tool = player.Backpack:children()[i]
player.Character.Humanoid:EquipTool(tool)
else
i = 1
end
end) |
|
FauxHawkeJoin Date: 2012-06-08 Post Count: 2190 |
Sweet, thanks man!!! |
|
smiley599Join Date: 2010-01-23 Post Count: 21869 |
I wonder how much of your FPS you're making yourself :) |
|
FauxHawkeJoin Date: 2012-06-08 Post Count: 2190 |
All of it, except for the meshes of course, and some maps. |
|