Hello, I have a problem with the if and elseif, and the problem comes when putting the text in a textLabel because there you choose in which language to put it, but it doesn’t put it and I don’t know what the reason is
server script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local FeedPlayerEvent = ReplicatedStorage:WaitForChild("FeedPlayer")
local function PlayerFeed(player, notify)
wait(0.3)
if notify ~= nil then
FeedPlayerEvent:FireAllClients(player.Name, "you winner of the money")
else
FeedPlayerEvent:FireAllClients(player.Name)
end
end
Players.PlayerAdded:Connect(PlayerFeed)
Players.PlayerRemoving:Connect(PlayerFeed)
FeedPlayerEvent.OnServerEvent:Connect(PlayerFeed)
LocalScript:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local SettingsData = player:WaitForChild("SettingsData")
local GameSettings = SettingsData:WaitForChild("GameSettings")
local LenguajeValue = GameSettings:WaitForChild("Language")
local FeedEvent = ReplicatedStorage.FeedPlayer
local actionFinish = {}
actionFinish.TextTransparency = 0
actionFinish.BackgroundTransparency = 0.4
local actionEnding = {}
actionEnding.TextTransparency = 1
actionEnding.BackgroundTransparency = 1
local Tweeninfo = TweenInfo.new(0.5)
FeedEvent.OnClientEvent:Connect(function(plr, notify)
wait()
local Template = Instance.new("TextLabel")
Template.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
Template.Font = Enum.Font.SourceSansBold
Template.BackgroundTransparency = 1
Template.TextTransparency = 1
Template.Text = ""
local Corner = Instance.new("UICorner", Template)
if notify ~= nil then
print(notify)
else
for _, players in pairs(Players:GetChildren()) do
if plr == players.Name then
if LenguajeValue.Value == "Spanish" then
Template.Text = plr.. " se unió al juego"
elseif LenguajeValue.Value == "English" then
Template.Text = plr.. " joined the game"
end
else
if LenguajeValue.Value == "Spanish" then
Template.Text = plr.. " se salió al juego"
elseif LenguajeValue.Value == "English" then
Template.Text = plr.. " came out to the game"
end
end
end
Template.Parent = script.Parent
TweenService:Create(Template,Tweeninfo, actionFinish):Play()
wait(7)
local FinishTween = TweenService:Create(Template,Tweeninfo, actionEnding)
FinishTween:Play()
FinishTween.Completed:Wait()
Template:Destroy()
end
end)