local owner = script.Parent.Parent.Parent.Parent.Parent.Owner
if owner and owner.Value then
script.Parent.Text = owner.Value.."'s Electronic Store"
else
warn("Owner value not found or invalid")
end
local owner = script.Parent.Parent.Parent.Parent.Parent.Owner
if owner then
owner.Changed:Connect(function(value)
if value then
script.Parent.Text = owner.Value.."'s Electronic Store"
end
end)
end
Just checking, are you correctly referencing the owner? Personally, I have never seen that many .Parents before in my life so you may be wrongly referencing it.
Could it be that you are using a Server-Script for this:
local owner = script.Parent.Parent.Parent.Parent.Parent.Owner
if owner and owner.Value then
script.Parent.Text = owner.Value.."'s Electronic Store"
else
warn("Owner value not found or invalid")
end
and you are using a Local-Script for the value to change? If that’s the case, then the value will still be “player” for the server and that’s the reason why it won’t change. The change is then not visible for the server. Only for the client.
If I am right, try to use a Server-Script where the value gets changed. Or instead use a Remote-Event.
Put a Remote-Event inside the ReplicatedStorage. Maybe name it something like “ChangeOwnerValueEvent”
Like this:
Server-Script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ChangeOwnerValueEvent = ReplicatedStorage:WaitForChild("ChangeOwnerValueEvent")
ChangeOwnerValueEvent.OnServerEvent:Connect(function(Player, Value) -- if you send more than 1 Value then: Example: (Player, Value, House, ...)
-- in case your game is multiplayer (which it probably is) send a second value to the server which makes sure it is the same tycoon. Or else this change will happen to every tycoon.
script.Parent.Text = Value.."'s Electronic Store"
end)
Local-Script (just implement this where the value gets changed):
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ChangeOwnerValueEvent = ReplicatedStorage:WaitForChild("ChangeOwnerValueEvent")
ChangeOwnerValueEvent:FireServer() -- put the value inside here, Example: FireServer(owner.Value)
-- if you need to send multiple values: Example: FireServer(owner.Value, "House1", ...)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ChangeOwnerValueEvent = ReplicatedStorage:WaitForChild("ChangeOwnerValueEvent")
ChangeOwnerValueEvent.OnServerEvent:Connect(function(Player, Value) -- if you send more than 1 Value then: Example: (Player, Value, House, ...)
-- in case your game is multiplayer (which it probably is) send a second value to the server which makes sure it is the same tycoon. Or else this change will happen to every tycoon.
script.Parent.Text = Value.."'s Electronic Store"
end)
by implementing something that checks if the tycoon is taken already? If it is taken then it can just ignore the Event.
Client-to-server data transmission is fundamentally vulnerable, as malicious users can manipulate the data being sent. Therefore, its not a good approach to receive important game data from the client. Client should request changes(to the server), not declare them.
You can store game data on the server and send it to the client when the client requests it.
It doesn’t seem inevitable that you need to :FireServer() in this post.
How about you make a script in a part with a .Touched function to detect if a player has touched it. Then, you obtain the Player’s name from that function, and make that value Owner instead?
I don’t know what you’re trying to do here with all these .Parent(s). Like, why would the script’s parent even be the owner?