NotSeany
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 9101 |
|
|
| 16 May 2015 05:32 PM |
This is a local script inside of the PlayerGui that I'm trying to use to make the BasePlate change to white should I press "w", 50 Robux to the winner! :P
player = game.Players.LocalPlayer mouse = player:GetMouse() BrickColour = game.Workspace.BasePlate.BrickColor MovementKeys = {"w", "a", "s", "d"}
mouse.KeyDown:connect(function(key) if key == MovementKeys[1] then BrickColour = BrickColor.new("White") end
end) |
|
|
| Report Abuse |
|
|
| |
|
NotSeany
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 9101 |
|
|
| 16 May 2015 05:37 PM |
| Sorry, I'm still a noob scripter, what do you mean by that? |
|
|
| Report Abuse |
|
|
NotSeany
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 9101 |
|
|
| 16 May 2015 05:42 PM |
| No error message in output. |
|
|
| Report Abuse |
|
|
|
| 16 May 2015 05:55 PM |
| is filtering enabled checked under workspace properties? |
|
|
| Report Abuse |
|
|
|
| 16 May 2015 05:59 PM |
local baseplate = workspace.BasePlate local CAS = game:GetService("ContextActionService")
local function setBaseplateColor(actionName, inputState, inputObject) if inputState == Enum.UserInputState.Begin then baseplate.BrickColor = BrickColor.new("White") end end
cas:BindAction("changeBaseplateColor", setBaseplateColor, false, Enum.KeyCode.W, Enum.KeyCode.A, Enum.KeyCode.S, Enum.KeyCode.D) |
|
|
| Report Abuse |
|
|
NotSeany
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 9101 |
|
|
| 16 May 2015 05:59 PM |
No :P, although I managed to fix the problem by making BrickColor no longer a variable.
player = game.Players.LocalPlayer mouse = player:GetMouse() MovementKeys = {"w", "a", "s", "d"}
mouse.KeyDown:connect(function(key) if key == MovementKeys[1] then game.Workspace.BasePlate.BrickColor = BrickColor.new("White") end
end) |
|
|
| Report Abuse |
|
|
|
| 16 May 2015 06:00 PM |
Oops, use this instead.
local baseplate = workspace.BasePlate local CAS = game:GetService("ContextActionService")
local function setBaseplateColor(actionName, inputState, inputObject) if inputState == Enum.UserInputState.Begin then baseplate.BrickColor = BrickColor.new("White") end end
CAS:BindAction("changeBaseplateColor", setBaseplateColor, false, Enum.KeyCode.W, Enum.KeyCode.A, Enum.KeyCode.S, Enum.KeyCode.D) |
|
|
| Report Abuse |
|
|
NotSeany
|
  |
| Joined: 18 Jun 2010 |
| Total Posts: 9101 |
|
|
| 16 May 2015 06:02 PM |
| Thanks, that worked too ^^. Although, I have no idea what's going on, I'm gonna look into that. |
|
|
| Report Abuse |
|
|