Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make an interaction with an object?

Asked by 5 years ago

So i was thinking about how to make an system in which i can interact with an object within a certain radius of it (ontouch) and press a key on my keyboard to interact with it. However, as i am not very good at server and client communication (aka remote events and remote functions), i need a lengthy guide on how to do so.

Here are my game mechanics in which i need this system:

  1. to destroy crates (containing keys to open doors) and enemies.
  2. to speak with npcs
  3. to open doors

I am using filtering enabled (to prevent exploiters from hacking my game) and i need a guide to do so. I could use an individual script for every door, npc, crate or enemy but as you probably have guessed that isnt very efficient as there will be lots of those. Thank you for your time!

0
You could put Items into folders and use the getChildren to get all the doors https://developer.roblox.com/api-reference/function/Instance/GetChildren BreadDestroyer 22 — 5y
0
just to clarify i want the server function (ontouch) script in the crate (in the workspace to communicate with the client function (when e is pressed) and revert back to the server to destroy the crate (or do anything with it really) tdljayden 1 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

****use this when a player touches something:****

function onTouched(hit) -- what you want to do gooes here end script.Parent.Touched:Connect(onTouched)

****NPC CHAT****

In an NPC, click on the NPC's head then add dialog, go onto the dialogs properties to change the text, then add dialog choice's to the dialog. You then add more dialog choice's to the dialog for as many times as you like

0
Im sorry to say this but your answer is a bit of a misunderstanding. I am using FE and i want to create a "custom" speech system and that requires use of an interaction system (the interactions system requires communication between the server and the client and i need remote functions/events to be able to make that work else it will do nothing.) tdljayden 1 — 5y
0
Plus, dialog choices are less likely to work with FE. DeceptiveCaster 3761 — 5y
Ad

Answer this question