I want to send the string form Table in ServerScript to LocalScript in
StarterGui.ScreenGui.Flame.TextLabel by remoteEvent
Server script (Named Quests) :
local rs = game:GetService("ReplicatedStorage")
local button = script.Parent.ProximityPrompt
local event = rs.Remotes:WaitForChild('RemoteDialogText')
local Quest = 60
local DialogsData = {
nic0 = "nie ma questa w domu ",
text2 = "nic2",
text3 = "nic3",
text60 ="No DAta"
}
button.Triggered:Connect(function(Plr)
local idk = Plr.Character
local Quests = idk.QuestsStatus
local name = Quests:GetAttribute("Name")
local lvl = Quests:GetAttribute("Status")
local Slowa = DialogsData[name..lvl]
event:FireClient(Slowa)
end)
Local Script:
local label = script.Parent
local rs = game:GetService("ReplicatedStorage")
local TextEvent = rs.Remotes.RemoteDialogText
TextEvent.OnClientEvent:Connect(function(plr,Slowa)
label.Text = Slowa
end)
when i print(“Slowa”) correct text will show up, but when I’m trying to send this by remoteEvent this happens:
I have no idea what I’m doing wrong.
(this is my first post, sorry if I did something wrong.)
local rs = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
local button = script.Parent.ProximityPrompt
local event = rs.Remotes:WaitForChild('RemoteDialogText')
local Quest = 60
local DialogsData = {
nic0 = "nie ma questa w domu ",
text2 = "nic2",
text3 = "nic3",
text60 ="No DAta"
}
button.Triggered:Connect(function(Plr)
local player = players:FindFirstChild(Plr.Name)
local idk = Plr.Character
local Quests = idk.QuestsStatus
local name = Quests:GetAttribute("Name")
local lvl = Quests:GetAttribute("Status")
local Slowa = DialogsData[name..lvl]
if player then
event:FireClient(player, Slowa)
end
end)