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: using an objectvalue as a path

Previous Thread :: Next Thread 
HungryBoy02 is not online. HungryBoy02
Joined: 03 Sep 2015
Total Posts: 257
16 Oct 2016 08:39 PM
so i have been using
Player = script.Parent.Script.Player.Value
mouse = Player:GetMouse()
Visibleval = script.Parent.Parent.Parent.Parent.Parent.Parent.Visibleval
mouse.KeyUp:connect(function(key)

with some other things and it has not been working, it is saying that mouse is a nil value, can somebody please help?



Report Abuse
Lykaon is not online. Lykaon
Joined: 27 Oct 2014
Total Posts: 784
16 Oct 2016 08:41 PM
you're identifying a value.

there is no such thing as a mouse in value


Report Abuse
HungryBoy02 is not online. HungryBoy02
Joined: 03 Sep 2015
Total Posts: 257
16 Oct 2016 08:42 PM
another thing, the script works in the studio test mode, but not in game


Report Abuse
HungryBoy02 is not online. HungryBoy02
Joined: 03 Sep 2015
Total Posts: 257
16 Oct 2016 08:43 PM
the value is the player, (an object value set by another script) and it usually works in studio but not in game.


Report Abuse
Lykaon is not online. Lykaon
Joined: 27 Oct 2014
Total Posts: 784
16 Oct 2016 08:46 PM
you cant access the value cross-script like this unless its a table, _G, or a modulescript


Report Abuse
HungryBoy02 is not online. HungryBoy02
Joined: 03 Sep 2015
Total Posts: 257
16 Oct 2016 08:50 PM
can you help me? i will add you to team create, i just don't understand



Report Abuse
Lykaon is not online. Lykaon
Joined: 27 Oct 2014
Total Posts: 784
16 Oct 2016 08:51 PM
okay


Report Abuse
HungryBoy02 is not online. HungryBoy02
Joined: 03 Sep 2015
Total Posts: 257
16 Oct 2016 08:54 PM
heres a link
https://www.roblox.com/games/405145421/HungryBoy02s-Place-Number-9


Report Abuse
Dev_Ryan is online. Dev_Ryan
Joined: 10 Mar 2013
Total Posts: 243
16 Oct 2016 08:59 PM
Since getting the mouse only works in a localscript, that means that each time you need to get the player, just do:

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()

also if you want to get keys being pressed, use UserInputService instead of Mouse:KeyUp/KeyDown

local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input)
if input and input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.E then -- the E key, change this to whatever.
-- do stuff when the key is held down
end
end
end)

You can also get the end of the key press like so:
UIS.InputEnded:Connect(function(input)
if input and input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.E then -- the E key, change this to whatever.
-- do stuff when the key is no longer held down.
end
end
end)


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