Hello, i’m trying to make it so that knit will call a client function from the server.
My one question is how?
This is what i’ve tried but it wouldn’t execute the function on the client, instead on the server.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local tweenService = game:GetService("TweenService")
local knit = require(ReplicatedStorage.Packages.Knit)
local signal = require(ReplicatedStorage:WaitForChild("Packages"):WaitForChild("Signal"))
local effectInfo = TweenInfo.new(0.5)
local EffectService = knit.CreateService {
Name = "EffectService",
}
function EffectService.Client:CreateEffect(player)
local effectFrame = Instance.new("Frame")
local effectGoals = {
BackgroundTransparency = 0
}
local effect = tweenService:Create(effectFrame, effectInfo, effectGoals)
effectFrame.BackgroundColor3 = Color3.fromRGB(0,0,0)
effectFrame.BackgroundTransparency = 1
effectFrame.BorderSizePixel = 0
effectFrame.Size = UDim2.fromScale(1,1)
effectFrame.ZIndex = 1000
effectFrame.Parent = Players.LocalPlayer.PlayerGui:WaitForChild("Ui")
effect:Play()
end
function EffectService:CreateEffect(player)
EffectService.Client:CreateEffect(player)
end
function EffectService:KnitInit()
print('knit init')
end
function EffectService:KnitStart()
end
return EffectService
thanks for the help in advance