Hi everyone,
I have been working on this for some time but I keep running into the same issue, this error:
ServerScriptService.GetPlayerInfo:4: attempt to concatenate string with Instance
keeps returning everthough I though I had already fixed it. It should been working al least. It works with 2 scripts, one server, the other local. The Localscript sends an remoteevent fire to the serverscript and than back. With that goes a variable callt “ID”. The ID is an stringvalue but and works in the local script, but when I use it in the serverscript it seems to not identify it like it should.
Serverscript:
local HttpService = game:GetService("HttpService")
game.ReplicatedStorage.GetGuilty.OnServerEvent:Connect(function(ID)
local url = "https://users.roproxy.com/v1/users/" .. ID
local success, response = pcall(function()
return HttpService:GetAsync(url)
end)
if success then
local data = HttpService:JSONDecode(response)
local created = data.created
local year, month, day = string.match(created, "(%d+)%-(%d+)%-(%d+)")
local joinDateText = day .. "/" .. month .. "/" .. year
game.ReplicatedStorage.GetPlayerInfoResult:FireClient(joinDateText)
else
warn("F*ck up while getting Playerinfo", response)
end
end)
Localscript:
local player = game.Players.LocalPlayer
local Players = game:GetService("Players")
local ID = script.Parent.Parent.ID.Value
script.Parent.MouseButton1Click:Connect(function()
player.PlayerGui.UI.Background.ScrollingFrame.Visible = false
local success, characterModel = pcall(function()
return Players:GetCharacterAppearanceAsync(ID)
end)
if success and characterModel then
characterModel.Parent = player.PlayerGui.UI.Background.InfoFrame.view.ViewportFrame.Sene
characterModel:MoveTo(player.PlayerGui.UI.Background.InfoFrame.view.ViewportFrame.Sene.PlaceHolderRig.PrimaryPart.Position)
player.PlayerGui.UI.Background.InfoFrame.view.ViewportFrame.Sene.PlaceHolderRig.Parent = player.PlayerGui.UI.Background.InfoFrame.view.ViewportFrame
else
warn("Couldn't find character")
end
player.PlayerGui.UI.Background.InfoFrame.Mugshot.ImageLabel.Image = "https://www.roblox.com/headshot-thumbnail/image?userId=" .. ID .. "&width=420&height=420&format=png"
game.ReplicatedStorage.GetPlayerInfo:FireServer(ID)
game.ReplicatedStorage.GetPlayerInfoResult.OnClientEvent:Connect(function(Result)
player.PlayerGui.UI.Background.InfoFrame.Joindate.Text = Result
end)
player.PlayerGui.UI.Background.InfoFrame.Visible = true
end)