#Remote Event doesnt fire unless i add a task.wait(0.1)

1 messages · Page 1 of 1 (latest)

unique ridge
#

local info = {}

function info.GetInfo()
local charInfo = {
stats = {
Health = 100
},
moveset = {
Special = {
Name = "Hairpin",
Cooldown = 20
},
One = {
Name = "Nail Shot",
Slot = 1,
Cooldown = 4
},
Two = {
Name = "Hammer Strike",
Slot = 2,
Cooldown = 15
},
Three = {
Name = "Resonating Combo",
Slot = 3,
Cooldown = 10
},
Four = {
Name = "Exorcise",
Slot = 4,
Cooldown = 10
}
}
}
return charInfo
end
function info.SetInfo(plr, char)
local charInfo = info.GetInfo()
for _, child in pairs(plr.Moveset.Base:GetChildren()) do
child:Destroy()
end
for k, c in charInfo do
print(k)
if k == "stats" then
for j, stat in c do
if j == "Health" then
char.Humanoid[j] = stat
char.Humanoid.MaxHealth = stat
end
end
elseif k == "moveset" then
for j, move in c do
local Move = Instance.new("Folder")
Move.Name = j
Move.Parent = plr.Moveset.Base
local Name = Instance.new("StringValue")
Name.Name = "Name"
Name.Value = move.Name
Name.Parent = Move
local Cooldown = Instance.new("NumberValue")
Cooldown.Name = "Cooldown"
Cooldown.Value = move.Cooldown
Cooldown.Parent = Move
end
end
end
print("Firing event for", plr.Name)
game:GetService("ReplicatedStorage").RemoteEvents.UpdateMoveGUI:FireClient(plr)
print("SDFSDF")
end

return info

#

this is a module that fires in a characteradded:connect

little mirage
unique ridge
little mirage
#

replace game.workspace with the thing thats receiving the event

#

like

#

plr.playerscripts

#

it would delay the next piece of code until the receiving end has loaded