Hello I'm Having Trouble With Coding, I'm Trying To Make This Piece Of Code Recognise It's A String But It Faults Back To Me Saying 'got object' Eventhough It's A String; I've Tried Multiple Ways Of Ensuring It's A String But I Have No Luck.. Got Any Answers?

Error Is On Line 4:

(I Tried To Use The Code Block Thing It Glitched So Here)

MainPlr = script.Parent.Name

game:GetService("Players").PlayerAdded:Connect(function(Plr)

PlrN = game:GetService("Workspace")[Plr].Name

local PR = game:GetService("ReplicatedStorage").PlrRecent:Clone()

PR.Parent = Plr.PlayerGui

game:GetService("Players")[Plr].PlayerGui.PlrRecent.Joined.Name = PlrN

game:GetService("Players")[Plr].PlayerGui.PlrRecent.Joined:TweenPosition(UDim2.new(0,0,0,0))

wait(0.2)

game:GetService("Players")[MainPlr].PlayerGui.PlrRecent.Joined.Name = PlrN

wait(2)

game:GetService("Players")[Plr].PlayerGui.PlrRecent.Joined:TweenPosition(UDim2.new(0,0,-1,0))

wait(1)

game:GetService("Players")[Plr].PlayerGui.PlrRecent:Destroy()

print("yes")

end)

1 comment

0

Format your code correctly.