|
| 07 Jan 2013 07:52 AM |
This is in a script in game.Workspace.Model It seems to work perfectly in solo play. I set up some hints to try and get some errors. It kept getting "Selected" then no keydown connection (Yes I clicked keys to make sure of this)
function MainDriver(Player) --Steer controler if Player.ClassName == "Weld" then Player = game.Players:findFirstChild(Player.Part1.Parent.Name) if Player:findFirstChild("PlayerGui") then Control1 = script.ControlGui:Clone() Control1.Parent = Player.PlayerGui Control11 = Instance.new("HopperBin",Player.Backpack) local DriverTool = Control11
local function KeyDown(Key) ------------Error apparently Hint.Text = "Keys loaded" if Key==Controls["DoorOpen"] then if script.Parent.Doors.Door.Transparency == 0 then script.Parent.Doors.Door.Transparency = 1 script.Parent.Doors.Door.CanCollide = false script.Parent.Doors.Door2.Transparency = 0 script.Parent.Doors.Door2.CanCollide = true else script.Parent.Doors.Door.Transparency = 0 script.Parent.Doors.Door.CanCollide = true script.Parent.Doors.Door2.Transparency = 1 script.Parent.Doors.Door2.CanCollide = false end end if Key==Controls["SteerRight"] then Steer = 1 elseif Key==Controls["SteerLeft"] then Steer = -1 end end
local function KeyUp(Key) if Key==Controls["SteerRight"] then Steer = 0 elseif Key==Controls["SteerLeft"] then Steer = 0 end end
local function Selected(mouse) Hint.Text = "Selected" mouse.KeyDown:connect(function(key) Hint.Text = "Keydown!" KeyDown(key) end) mouse.KeyUp:connect(function(key) Hint.Text = "KeyUp!" KeyUp(key) end) if mouse == nil then Hint.Text = "Mouse nil." end end DriverTool.Selected:connect(Selected) DriverTool.Parent = Player.Backpack Hint.Text = "MainDriver added" end end end |
|
|
| Report Abuse |
|
|
|
| 07 Jan 2013 07:58 AM |
| Roblox decided to attempt to make everyone happy and, in doing so, removed the mouse function for normal scripts. Mouse can only be accessed on client(LocalScripts) now thanks to their great ideas. |
|
|
| Report Abuse |
|
|
|
| 07 Jan 2013 08:01 AM |
| Script doesn't even work as a local. Lol. |
|
|
| Report Abuse |
|
|
Monkey727
|
  |
| Joined: 12 Jan 2009 |
| Total Posts: 969 |
|
|
| 07 Jan 2013 08:06 AM |
| Local Scripts only run inside the Player, e.g. Player's Character, PlayerGui, Backpack, Tool/Hopperbin |
|
|
| Report Abuse |
|
|
|
| 07 Jan 2013 08:11 AM |
| Considering all the glitches Local Scripts seem to have in play, I don't think that's the case anymore. |
|
|
| Report Abuse |
|
|