#How do I make my GUI change after a remote is fired?
40 messages · Page 1 of 1 (latest)
remote event or remote function ?
Remote event
** You are now Level 1! **
Im writing the script right now
Code:
local Players = game:GetService(“Players”)
local RP = game:GetService(“ReplicatedStorage”)
local remotes = RP.Remotes
local BoostRemote = remotes.Boost
local function all()
local player = game.Players.PlayerAdded wait()
local character = player.Character or player.CharacterAdded wait()
local GuiService = game:GetService(“StarterGui”)
local sha = GuiService:WaitForChild(“PreBoostGui”)
local BoostGui = GuiService:WaitForChild(“BoostGui”)
local glassSound = Instance.new(“Sound)
—(Here sound details like volume and id)—
local crack = Instance.new(“Sound”)
—(Sound details)—
crack:Clone()
crack.Parent = character
crack:Play()
sha.Enabled = true
task.wait(0.2)
crack:Stop()
crack:Destroy()
glassSound:Clone()
glassSound:Play()
sha.Enabled = false
BoostGui.Enabled = true
Continuation:
if you want to do something when a remote event is called you need to do this:
local RemoteEvent = path.to.remote:WaitForChild("event")
RemoteEvent.OnServerEvent:Connect(function(player, ...args) -- on .OnClientEvent if in local script
-- code here
end)
local ssound1 = Instance.new(“Sound”)
local ssound2 = Instance.new(“Sound”)
—(Sound details)—
ssound1:Clone()
ssound1.Parent = character
ssound1:Play()
ssound2:Clone()
ssound2.Parent = character
ssound2:Play()
task.wait(6.4)
ssound1:Stop()
ssound2:Stop
BoostGui.Enabled = false
task.wait(0.1)
ssound1:Destroy
ssound2:Destroy
end
remotes.Boost.OnClientEvent:Connect(all)
Thanks
I’ll try
is there an error?
No
also does a script :FireClient() or :FireAllClients() ?
look, you fired the remote event for the server but your sound local script is listening for client fires
** You are now Level 2! **
So I write fire:client?
i am not sure if you can fire from a client to a client but you can try
Ok
i think you can only fire from client to server or from server to client
I got error argument 1 missing or nil
set line 7 to BoostRemote.OnClientEvent:Connect(function() instead of BoostRemote.OnClientEvent:Connect(function(all)
then it should work
@topaz frost does it work ?
Ok im going to check
No
Does a local script need to fire a client or a normal script?
i dont know that
a local script can fire a server sciprt but i dont know if it can fire another client
Not working