So I'm using this script in a SurfaceGui which is attached to a part in the game so all players can use it locally, note my game is filtering enabled.
local jobName = "Cafe"
local announceText = "Urban Life Jobs | You now work at "..jobName.."!"
local plr = game.Players.LocalPlayer
local plrGui = plr:FindFirstChild("PlayerGui")
local announce = plrGui.mainGui.Border
print("Hola")
script.Parent.MouseButton1Down:connect(function()
local announceMsg = game.Players.LocalPlayer.PlayerGui:FindFirstChild("announceBar")
if announceMsg == true then
local textBar = Instance.new("Frame", announce)
textBar.Name = "textBar"
textBar.Size = UDim2.new(1, 0, 0, 20)
textBar.Position = UDim2.new(0, 0, -1, 0)
textBar.BackgroundTransparency = 0
textBar.BorderSizePixel = 0
local bar = Instance.new("TextLabel", textBar)
bar.BackgroundTransparency = 0
bar.Text = announceText
bar.Position = UDim2.new(0, 0, -1, 0)
bar.Size = UDim2.new(1, 0, 0, 20)
bar.TextColor3 = Color3.fromRGB(255, 0, 0)
bar.Font = "SouceSansLight"
bar.FontSize = "Size18"
bar.Name = "announceBar"
bar.TextScaled = true
bar.TextWrapped = true
wait(1)
plrGui.mainGui.Border.textBar:TweenPosition(UDim2.new(0, 0, 0, 0) 'Out', 'Linear', 1, false)
announceMsg.Position:TweenPosition(UDim2.new(announceMsg.Position + UDim2.new(0, 0, 0.05, 0)), 'Out', 'Linear', 1, false)
else
local textBar = Instance.new("Frame", announce)
textBar.Name = "textBar"
textBar.Size = UDim2.new(1, 0, 0, 20)
textBar.BackgroundTransparency = 0
textBar.BorderSizePixel = 0
local bar = Instance.new("TextLabel", textBar)
bar.BackgroundTransparency = 0
bar.Text = announceText
bar.Position = UDim2.new(0, 0, -1, 0)
bar.Size = UDim2.new(1, 0, 0, 20)
bar.TextColor3 = Color3.fromRGB(255, 0, 0)
bar.Font = Enum.Font.SourceSansLight
bar.FontSize = Enum.FontSize.Size18
bar.Name = "announceBar"
bar.TextScaled = true
bar.TextWrapped = true
wait(1)
plrGui.mainGui.Border.textBar:TweenPosition(UDim2.new(0, 0, 0, 0) 'Out', 'Linear', 1, false)
end
end)
The error I'm receiving is:
Players.Player1.PlayerGui.JobSelector.ScrollingFrame.B-cafeJob.LocalScript:53: attempt to call a userdata value
EDIT: I just fixed the script, I decided to use a remote event to transfer the values instead

2 comments
Which line is line 53?
It's okay I fixed it :) I just used a remote event