I’m currently trying to replicate some tweens to all clients using a remote. With the instance (an union) i’m trying to tween, I’m also passing the values to apply to the tween.
Module script (server side):
local function AoE(Shard,caster)
local AoE_Hitbox = Shard:WaitForChild("AoE")
local dictionary = {}
--Remote part causing me problems
Data.Replicator:FireAllClients("cryogen",AoE_Hitbox,Data.Speed,Data.Frequency,Data.Range)
--Ignore this part
AoE_Hitbox.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and dictionary[player.Name] == nil and player.Name ~= caster.Name then --nil or false
dictionary[player.Name] = true
hit.Parent:FindFirstChild("Humanoid"):TakeDamage(Data.Damage)
wait(Data.Speed)
dictionary[player.Name] = nil
end
end)
end
Local script placed inside StarterGui (would it work also placed in StarterPack?)
local Services = require(game:GetService("ReplicatedStorage"):FindFirstChild("Services"))
local Replicator = Services.RS:WaitForChild("Replicator")
local Player = Services.Players.LocalPlayer
Replicator.OnClientEvent:Connect(function(skill,AoE,Speed,Frequency,Range)
if skill == "cryogen" then
local Goal = {Size = Range, Transparency = 1}
local Info = TweenInfo.new(Speed,Enum.EasingStyle.Exponential,Enum.EasingDirection.Out,-1,false,Frequency)
local Tween = Services.TS:Create(AoE,Info,Goal)
Tween:Play()
end
end)
Whenever i trigger the remote, it gives me this error:
Here is the full server script, if it can help. I didn’t include it fully because it’s a bit lenghty and seemed useless because I don’t think it’s the cause of my problem but I might be wrong.
Pastebin link