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: press e to interact with an object in workspace

Previous Thread :: Next Thread 
gohan31865 is not online. gohan31865
Joined: 30 Jan 2011
Total Posts: 895
27 Aug 2017 09:40 PM
so to get "e" then i use a local script right? yes i do, but what if i want it to trigger a billboard gui on an object in workspace? and what if i want it to be in a certain radius? .magnitude? give ideas pls
Report Abuse
gohan31865 is not online. gohan31865
Joined: 30 Jan 2011
Total Posts: 895
27 Aug 2017 09:55 PM
can i just throw a billboard gui into startergui and then set its adornee?
Report Abuse
systematicaddict is not online. systematicaddict
Joined: 13 Jul 2012
Total Posts: 4188
27 Aug 2017 10:00 PM
Do you want it to show the GUI when the mouse hovers over it or when the player is near?
Report Abuse
systematicaddict is not online. systematicaddict
Joined: 13 Jul 2012
Total Posts: 4188
27 Aug 2017 10:01 PM
Also, yes, you can do that, and I would recommend it for easier interaction between the player and gui.
Report Abuse
gohan31865 is not online. gohan31865
Joined: 30 Jan 2011
Total Posts: 895
27 Aug 2017 10:05 PM
i want it to be nearby, but then i run into the problem of whether or not to use a server script placed inside of the object just to find the magnitude. and if i do that then i have to use remote events to trigger the local script to be able to interact with such object. im hoping theres a better solution to this
Report Abuse
systematicaddict is not online. systematicaddict
Joined: 13 Jul 2012
Total Posts: 4188
27 Aug 2017 10:14 PM
I think the real question is what event you want to check the magnitude on, or if you want to do an infinite loop
Report Abuse
gohan31865 is not online. gohan31865
Joined: 30 Jan 2011
Total Posts: 895
27 Aug 2017 10:18 PM
i want it to check if the players nearby?

check .magnitude to see if they're within a certain radius, still unsure if remote events are necessary
Report Abuse
raik220 is not online. raik220
Joined: 13 Jun 2011
Total Posts: 241
27 Aug 2017 10:19 PM
not 100% sure because i haven't gotten around to it, but i think roblox's tag system would help reduce the amount of things you would have to loop through.
Report Abuse
gohan31865 is not online. gohan31865
Joined: 30 Jan 2011
Total Posts: 895
27 Aug 2017 10:20 PM
isnt there an event for players being nearby the object? or am i wrong?
Report Abuse
Alend43 is not online. Alend43
Joined: 13 Nov 2013
Total Posts: 451
27 Aug 2017 10:22 PM
I actually need help with a VERY Similar script.

local rootpart = game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
local frame = script.Parent.ScreenGui.Frame
npc = game.Workspace.n0b:FindFirstChild("Torso")
distance = 12.5


while true do
if (rootpart.Position - npc.Position).Magnitude <= distance then
game:GetService("UserInputService").InputBegan:connect(function(PressedKey)
if PressedKey.KeyCode == Enum.KeyCode.E then
if frame.Visible == false then
frame.Visible = true
end
end
end)
elseif (rootpart.Position - npc.Position).Magnitude >= distance then
frame.Visible = false
end
wait(0.01)
end

This script is just like yours, put instead of a billboard gui, its a frame inside a screen gui. This works in studio but not in a real server. If someone could crack this, it would work for both of us
Report Abuse
gohan31865 is not online. gohan31865
Joined: 30 Jan 2011
Total Posts: 895
27 Aug 2017 10:25 PM
no i havent wrote mine yet, i just need ideas as to how i should pull this off. i greatly dislike having to use an infinite loop just to check if the player is near the object. and on top of that, i plan to have MULTIPLE objects that the player can interact with, so i cant afford to use infinite loops freely.
Report Abuse
raik220 is not online. raik220
Joined: 13 Jun 2011
Total Posts: 241
27 Aug 2017 10:27 PM
http://wiki.roblox.com/index.php?title=API:Class/Player/DistanceFromCharacter

this may help, but ive never personally used it.
Report Abuse
gohan31865 is not online. gohan31865
Joined: 30 Jan 2011
Total Posts: 895
27 Aug 2017 10:32 PM
it definitely would, if i knew whether or not to use two seperate scripts for this one feature (one local, and one for the object), or just one. what would be the cleanest way to do this without having to delve into infinite loops? or is there no escape for me?

how did jailbreak do it?
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