|
| 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 |
|
|
|
| 27 Aug 2017 09:55 PM |
| can i just throw a billboard gui into startergui and then set its adornee? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 27 Aug 2017 10:20 PM |
| isnt there an event for players being nearby the object? or am i wrong? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|