New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Still have questions? Join our Discord server and get real time help.
0

# How in the heck would I do this? (Is this specific enough, title bot?)

If I 'elaborated on my question' my title would be way too long.

Basically, this scriptinghelpers post tells me that, in order to make car headlights, I must place a RemoteEvent inside the car, a LocalScript in an unspecificed location, and a script inside the car. I've put the LocalScript in the RemoteEvent. It needs to be somewhere in the car because the car is referred to as 'script.Parent.Parent' several times. I can't say 'game.Workspace...' because, should my game get any traction, there will be several people driving the same type of car. RemoteEvents require LocalScripts, don't they? LocalScripts must be in a player to work, right? So, how can I have a RemoteEvent connected to a local script which is inside a car? If that isn't possible, how can I have a RemoteEvent perform its function with a script that is inside of a car? How can I make car headlights with FE?

Here are the scripts, if you need them:

LocalScript:

local player = game:GetService("Players").LocalPlayer
local HondaAccordWagon = script.Parent.Parent.Parent.Parent
local UIS = game:GetService("UserInputService")

UIS.InputBegan:Connect(function(inputObject)
if inputObject.KeyCode == Enum.Keycode.L then

script.Parent:FireServer()
end
end)



Normal script:

local HondaAccordWagon = script.Parent.Parent

HondaAccordWagon.RemoteEvent.OnServerEvent:Connect(function(player)
HondaAccordWagon.RemoteEvent.OnServerEvent:Connect(function(player)
else
end
end)


Yes, I stole the scripts from the aforementioned scriptinghelpers post. Do I feel bad at all? Nope.

0
a local script HAS to be a child of the player, it will not run if it is in the workspace. Fad99 277 — 11d
0
yes it will? KDarren12 690 — 11d
0
Okay, great, but I need it to be there because it MUST reference 'script.Parent.Parent' and not 'game.Workspace....' How would I make a set of headlights using FE and by referencing 'script.Parent.Parent' and not 'game.Workspace...."? sesamert16 29 — 11d
0
To make your game future proof: There should be ONE local script in StarterPlayer. There should be ONE Remote event in ReplicatedStorage. Server should know which car player is in, and act accordingly. sleazel 679 — 11d