#Remote Event Thing

1 messages · Page 1 of 1 (latest)

flint axle
#

Server script inside a part

local prompt = script.Parent.ProximityPrompt
local ReplicatedStorage = game:GetService("ReplicatedStorage")

-- RemoteEvent to tell the client to open the GUI
local openGuiEvent = ReplicatedStorage:WaitForChild("OpenSellShopGui")

prompt.Triggered:Connect(function(player)
openGuiEvent:FireClient(player)
end)

Local script inside a billboard gui inside a npc's torso

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local gui = script.Parent

local openGuiEvent = ReplicatedStorage:WaitForChild("OpenSellShopGui")

openGuiEvent.OnClientEvent:Connect(function()
if gui.Enabled then
print("Sell shop is already opened")
else
gui.Enabled = true
end
end)

The gui is a billboard gui

balmy magnet
flint axle
#

put the wrong thing

#

it's inside the gui

balmy magnet
#

and where is the ui located?

flint axle
#

in the torso

balmy magnet
#

....

flint axle
#

changed gui to script.Parent

balmy magnet
#

Any local script that you wish to actually compile must be placed in one of those bins (indirectly will also work, i.e. StarterGui -> ScreenGui -> local script)

flint axle
#

ima just use starterplayerscripts

#

k there

#

it works thanks

#

@balmy magnet

#

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local gui = game.Workspace:WaitForChild("NPCGiant_breakerGuy2000"):WaitForChild("Torso"):WaitForChild("BillboardGuis"):GetChildren()
local openGuiEvent = ReplicatedStorage:WaitForChild("OpenSellShopGui")

openGuiEvent.OnClientEvent:Connect(function()
if gui.Enabled then
print("Sell shop is already opened")
else
gui.Enabled = true
end
end)

#

i have multiple now

#

billboardguis is a folder

#

how do i make everything in the table enabled