generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Got a problem

Previous Thread :: Next Thread 
NotSeany is not online. 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
lego555444 is not online. lego555444
Joined: 21 Sep 2008
Total Posts: 1383
16 May 2015 05:36 PM
filtering enabled?
Report Abuse
NotSeany is not online. 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 is not online. NotSeany
Joined: 18 Jun 2010
Total Posts: 9101
16 May 2015 05:42 PM
No error message in output.
Report Abuse
lego555444 is not online. lego555444
Joined: 21 Sep 2008
Total Posts: 1383
16 May 2015 05:55 PM
is filtering enabled checked under workspace properties?
Report Abuse
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
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 is not online. 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
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image