#Help.

35 messages · Page 1 of 1 (latest)

vernal sun
#
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")

local messageStorage = ReplicatedStorage:WaitForChild("MessageStorage")
local messageValue = messageStorage:WaitForChild(player.Name)

local screenGui = Instance.new("ScreenGui")
screenGui.Parent = playerGui

local frame = Instance.new("Frame")
frame.Size = UDim2.new(1, 0, 0, 100)
frame.BackgroundColor3 = Color3.fromRGB(255, 223, 0) 
frame.BackgroundTransparency = 0.5 
frame.BorderSizePixel = 0
frame.Position = UDim2.new(0, 0, 0, 0)
frame.Parent = screenGui

local largeTextLabel = Instance.new("TextLabel")
largeTextLabel.Size = UDim2.new(1, 0, 0.5, 0)
largeTextLabel.TextSize = 24
largeTextLabel.TextWrapped = true
largeTextLabel.TextColor3 = Color3.new(1, 1, 1)
largeTextLabel.Parent = frame

local messageTextLabel = Instance.new("TextLabel")
messageTextLabel.Size = UDim2.new(1, 0, 0.5, 0)
messageTextLabel.Position = UDim2.new(0, 0, 0.5, 0)
messageTextLabel.TextSize = 18
messageTextLabel.TextWrapped = true
messageTextLabel.TextColor3 = Color3.new(1, 1, 1)
messageTextLabel.Parent = frame

local function updateMessage()
local message = messageValue.Value
if message and message ~= "" then
local pinnedUser = messageValue.UserPinned or "Unknown"
largeTextLabel.Text = "PINNED BY " .. pinnedUser
messageTextLabel.Text = message
frame.Visible = true
else
frame.Visible = false
end
end

messageValue.Changed:Connect(updateMessage)
updateMessage()```

Help, it works but where it was supposed to say "Pinned by (username)", it says Label there and also the description message too despite it was set to something else
timid dome
#

Try debugging the updateMessage() function

vernal sun
#

there's nothing in logs

timid dome
#

So that means that the function isn't runnin

#

Try running it without the messageValue.Changed

vernal sun
timid dome
#

Wait, so when u did the debug what did u do exactly? What did u change?

vernal sun
#

local function updateMessage()
local message = messageValue.Value
if message and message ~= "" then
local pinnedUser = messageValue.UserPinned or "Unknown"
print("Debug - Pinned By:", pinnedUser)
print("Debug - Message:", message)

    largeTextLabel.Text = "PINNED BY " .. pinnedUser
    messageTextLabel.Text = message
    frame.Visible = true
else
    frame.Visible = false
end

end

timid dome
#

What for debugging I do:

  • print statements as soon as there is an if/else statement so I know what is running
vernal sun
#

Thats how i debugged

timid dome
#

Ty debugging the else statement

vernal sun
#

kk

timid dome
#

What does it print?

#

The code u sent

vernal sun
#

it prints nothing

#

except

#

these

#

15:24:13.331 Stack End - Studio
15:24:13.331 Infinite yield possible on 'cloud_218303841.Model.GUIs.SignalGUI.Scripts:WaitForChild("Mode")' - Studio
15:24:13.331 Stack Begin - Studio
15:24:13.331 Script 'cloud_218303841.Model.GUIs.SignalGUI.Scripts.3', Line 10 - Studio
15:24:13.331 Stack End - Studio
15:24:17.816 Infinite yield possible on 'cloud_218303841.Model.GUIs.SignalGUI.Scripts:WaitForChild("Mode")' - Studio
15:24:17.816 Stack Begin - Studio
15:24:17.816 Script 'cloud_218303841.Model.GUIs.SignalGUI.Scripts.4', Line 11 - Studio
15:24:17.816 Stack End - Studio
15:24:17.816 Infinite yield possible on 'cloud_218303841.Model.GUIs.SignalGUI.Scripts:WaitForChild("Mode")' - Studio
15:24:17.816 Stack Begin - Studio
15:24:17.816 Script 'cloud_218303841.Model.GUIs.SignalGUI.Scripts.3', Line 10 - Studio
15:24:17.816 Stack End - Studio

#

now it prints this

#

15:24:43.360 Stack End - Studio
15:24:59.665 UserPinned is not a valid member of StringValue "ReplicatedStorage.MessageStorage.AdenExtra" - Client - LocalScript:40
15:24:59.665 Stack Begin - Studio
15:24:59.666 Script 'Players.AdenExtra.PlayerScripts.LocalScript', Line 40 - function updateMessage - Studio - LocalScript:40
15:24:59.666 Stack End - Studio

#

Ok i did some working out

#

now it works

vernal sun
#

@timid dome Can you help with another thing

#

I came across another problem

timid dome
#

Go ahead

vernal sun
#

it works now but where it was supposed to say "Pinned by (username)", it says Unknown instead and doesn't say the actual username who used the command

timid dome
#

Pastebin pls, not random files

vernal sun
#

doesn't let me send

#

over the limit