|
| 15 Oct 2017 05:05 AM |
I can't seem to figure out how to create a gui so when you come close to the door it shows a gui saying "press e to open" door and then you can press e and the door will open.
*drops microphone |
|
|
| Report Abuse |
|
|
jhammer41
|
  |
| Joined: 24 Jul 2011 |
| Total Posts: 17 |
|
|
| 15 Oct 2017 05:09 AM |
I know how to do it (Maybe it works)
I have created a script and put it in the Player Starter Pack.
SCRIPT: Player = script.Parent.Parent mouse = Player:GetMouse()
function onKeyDown(key) key = key:lower()
if key == "e" then |
|
|
| Report Abuse |
|
|
ZombiDev
|
  |
| Joined: 20 Aug 2016 |
| Total Posts: 2106 |
|
|
| 15 Oct 2017 05:14 AM |
| please dont make an oder game but ^ |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2017 05:15 AM |
yea its not for an oder game
*drops microphone |
|
|
| Report Abuse |
|
|
ZombiDev
|
  |
| Joined: 20 Aug 2016 |
| Total Posts: 2106 |
|
|
| 15 Oct 2017 05:18 AM |
I didn't mean to post that on this thread, sorry.
Zombi#0706 | Lua & C# Developer | Web Developer | Graphics Artist | |
|
|
| Report Abuse |
|
|
|
| 15 Oct 2017 05:24 AM |
Assuming you know how to script
Add an objectvalue inside player somewhere
add a local script that changes the object inside objectvalue's value, CanCollide to false everytime player pressed E
make an invisible part slightly bigger than the door, put it in the same position as the door.
when touched, add the gui into player's gui folder and changes objectvalue's value that i mention earlier into the door.
and then when untouched remove the gui and change the value of objectvalue to nil.
Don't forget a debounce so that multiple guis won't show up.
|
|
|
| Report Abuse |
|
|
|
| 15 Oct 2017 05:25 AM |
| Forget to mention the Touched and TouchEnded script should be made inside the invisible part |
|
|
| Report Abuse |
|
|
jhammer41
|
  |
| Joined: 24 Jul 2011 |
| Total Posts: 17 |
|
| |
|
|
| 15 Oct 2017 10:25 AM |
local Wood = true
local parent = script.Parent
local function on() Wood = true parent.Transparency = 0 parent.CanCollide = true end
local function off() Wood = false parent.Transparency = 0.8 parent.CanCollide = false end
local function OnClicked() if Wood == true then off() else on() end end parent.ClickDetector.MouseClick:connect(OnClicked)
on() |
|
|
| Report Abuse |
|
|
K7Q
|
  |
| Joined: 23 Mar 2013 |
| Total Posts: 5546 |
|
|
| 15 Oct 2017 10:27 AM |
dont listen to any of these trash scripters, its obvious they just recently learned to script so they make these sub par transparency type scripts and its cringy and bad
|
|
|
| Report Abuse |
|
|
jhammer41
|
  |
| Joined: 24 Jul 2011 |
| Total Posts: 17 |
|
| |
|
K7Q
|
  |
| Joined: 23 Mar 2013 |
| Total Posts: 5546 |
|
| |
|
ZombiDev
|
  |
| Joined: 20 Aug 2016 |
| Total Posts: 2106 |
|
|
| 15 Oct 2017 08:31 PM |
| @K7Q i bet you use alvinblox tutorials lmao |
|
|
| Report Abuse |
|
|
K7Q
|
  |
| Joined: 23 Mar 2013 |
| Total Posts: 5546 |
|
|
| 15 Oct 2017 09:50 PM |
@zombi
funny when you probably starting coding a year ago and you joined last year, serious loser you are lool. |
|
|
| Report Abuse |
|
|
|
| 16 Oct 2017 02:49 AM |
| @K7Q Tell is your solution to his problem then, senior scripter. |
|
|
| Report Abuse |
|
|
| |
|
K7Q
|
  |
| Joined: 23 Mar 2013 |
| Total Posts: 5546 |
|
|
| 16 Oct 2017 12:21 PM |
use magnitude to get the distance from the player, if the player is close enough then clone a screengui into playergui and the playergui would have a script that would open the door if 'e' was pressed.
@OP is this door only opened by one player or multiple? |
|
|
| Report Abuse |
|
|
|
| 16 Oct 2017 05:47 PM |
Won't that cause lag, assuming there is a lot of door, and will it cause problem in this scenario:
The player is in the first floor of the building, And the door is on second floor.
Won't the player be able to open the door on the second floor? |
|
|
| Report Abuse |
|
|
|
| 16 Oct 2017 05:50 PM |
| Wow, I just realized how terrible the grammar I used there, sorry if it burn your eyes. |
|
|
| Report Abuse |
|
|
K7Q
|
  |
| Joined: 23 Mar 2013 |
| Total Posts: 5546 |
|
|
| 16 Oct 2017 06:39 PM |
| there is no thing around it then unless you would rather have like an invisible block and then and just used debounce to prevent it from spazzing out, senior scripter. |
|
|
| Report Abuse |
|
|
ZombiDev
|
  |
| Joined: 20 Aug 2016 |
| Total Posts: 2106 |
|
|
| 16 Oct 2017 06:46 PM |
@K7Q
I've been scripting for 6 years and I know 6 different languages while you probably struggle in simple lua |
|
|
| Report Abuse |
|
|
ZombiDev
|
  |
| Joined: 20 Aug 2016 |
| Total Posts: 2106 |
|
|
| 16 Oct 2017 06:51 PM |
| ^ I know more if you count stuff like SQL. |
|
|
| Report Abuse |
|
|
K7Q
|
  |
| Joined: 23 Mar 2013 |
| Total Posts: 5546 |
|
|
| 16 Oct 2017 07:04 PM |
| oh yes you are pro scripter thats why you have so many failed projects |
|
|
| Report Abuse |
|
|
| |
|
ZombiDev
|
  |
| Joined: 20 Aug 2016 |
| Total Posts: 2106 |
|
|
| 17 Oct 2017 01:09 AM |
| Everyone has failed projects, if you’ve never had a failed project that means you are a horrible scripter and will never learn any new languages. |
|
|
| Report Abuse |
|
|