You just need to find where the button is located in the explorer, then reference to that, for example:
I would replace StarterGui
with player.PlayerGui
then do
local button = player.PlayerGui.Buttons.Build.Button
You just need to find where the button is located in the explorer, then reference to that, for example:
I would replace StarterGui
with player.PlayerGui
then do
local button = player.PlayerGui.Buttons.Build.Button
i referenced the part and nothing happend (sorry for late response)
You would do
local button = script.Parent
Assuming that local script is the one you’re using
local player = game.Players.LocalPlayer
local button = script.Parent
button.MouseButton1Up:Connect(function()
-- add your code here to replace the wallpaper
end)
so this?
local player = game.Players.LocalPlayer
local button = script.Parent
button.MouseButton1Up:Connect(function()
player.PlayerGui.DefaultWallPaper.ChangePic1.Image = “rbxassetid://1011934257”
end)
Yeah
So thats what i needed but it didnt work…
Are there any errors?
ChangePic1 is not a valid member of ScreenGui “Players.SomeOddYtber2.PlayerGui.DefaultWallPaper”
Is that where you set the button variable? If not, replace the .ChangePic1
for :WaitForChild("ChangePic1")
this is the code i got right know
local player = game.Players.LocalPlayer
local button = player.PlayerGui.TextButton
button.MouseButton1Up:Connect(function()
player.PlayerGui.DefaultWallPaper.ImageLabel.Image = “rbxassetid://1011934257”
end)
Replace local button = player.PlayerGui.TextButton
for local button = script.Parent
Thank you so much! and everyone else who helped