-
What do you want to achieve? Keep it simple and clear!
I want to make a part that you can claim, and only you can edit that part. -
What is the issue? Include screenshots / videos if possible!
I added to parts to test if it would work, but it didn’t, it will edit for both parts but I don’t know what to do. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried the dev hub, devforum, scripting helpers, and youtube but still haven’t found my answer.
I do have some scripts to show you:
-- Child Of ClickDetector
local PlayerCollectedItem = false
local Status = script.Parent.Parent.Status
game.Players.PlayerAdded:Connect(function(player)
script.Parent.MouseClick:Connect(function(player)
Status.Value = player.Name
PlayerCollectedItem = true
script.Parent.Parent.BillboardGui.TextLabel.Text = "Owned By "..player.Name
local ObjectValue = Instance.new("ObjectValue")
ObjectValue.Name = "ObjectValue"
ObjectValue.Value = workspace.MainParts.Main1
ObjectValue.Parent = player
end)
end)
-- MainPart1(Child Of Folder, Folder Inside Frame)
local remoteEvent = game:GetService("ReplicatedStorage").EditMessage
local EditButtonUi = game.Players.LocalPlayer.PlayerGui:WaitForChild("EditingUi").EditButton
script.Parent.Parent.DoneButton.MouseButton1Click:Connect(function()
remoteEvent:FireServer(workspace.MainParts.Main1, "name", script.Parent.Parent.GameName.Text)
remoteEvent:FireServer("description", script.Parent.Parent.Description.Text)
game.Players.LocalPlayer.PlayerGui:WaitForChild("EditingUi").EditGui.Visible = false
EditButtonUi.Visible = true
end)
remoteEvent.OnClientEvent:Connect(function(type_, message)
if type_ == "name" then
workspace.MainParts.Main1.SurfaceGui.GameNameLabel.Text = message
elseif type_ == "description"then
workspace.MainParts.Main1.SurfaceGui.GameDescriptionLabel.Text = message
end
end)
-- MainPart2(Child Of Folder, Folder Inside Frame)
local remoteEvent = game:GetService("ReplicatedStorage").EditMessage
local EditButtonUi = game.Players.LocalPlayer.PlayerGui:WaitForChild("EditingUi").EditButton
script.Parent.Parent.DoneButton.MouseButton1Click:Connect(function()
remoteEvent:FireServer("name", script.Parent.Parent.GameName.Text)
remoteEvent:FireServer("description", script.Parent.Parent.Description.Text)
game.Players.LocalPlayer.PlayerGui:WaitForChild("EditingUi").EditGui.Visible = false
EditButtonUi.Visible = true
end)
remoteEvent.OnClientEvent:Connect(function(type_, message)
if type_ == "name" then
workspace.MainParts.Main2.SurfaceGui.GameNameLabel.Text = message
elseif type_ == "description" then
workspace.MainParts.Main2.SurfaceGui.GameDescriptionLabel.Text = message
end
end)
--Server Script(Child Of Surface Gui's. Suface Guis inside the main Parts)
local remoteEvent = game:GetService("ReplicatedStorage").EditMessage
game.Players.PlayerAdded:Connect(function(player)
script.Parent.Parent.ClickDetector.MouseClick:Connect(function(player)
player.PlayerGui:WaitForChild("EditingUi").EditGui.Visible = true
end)
end)
remoteEvent.OnServerEvent:Connect(function(player, type_, message)
remoteEvent:FireAllClients(type_, game:GetService("Chat"):FilterStringForBroadcast(message, player)) --Send our message back to all clients.
end)
robloxapp-20210831-1955311.wmv (1.1 MB)