In studio, this script works perfectly:
game.ReplicatedStorage.spon1.OnServerEvent:Connect(function(player)
local a = Instance.new("StringValue")
a.Name = "spon"
a.Value = player.Sponsor.Frame.items.a.Text
a.Parent = game.ReplicatedStorage.Sponsored
end)
However, when I try it in the real game, it says that 'sponsor is not a vaild member of playergui', when it is. Does anyone have any idea why this is happening?

4 comments
when I try to make a string value through a local script, that doesnt work also
What do you mean? The StringValue you are trying to create in the code you put in your question?
In the Solo mode, everything is not run locally, it is the client and server are not separated, this is why LocalScripts may be able to access ServerStorage, or a Script accessing UserInputService, when in a resl server this is not allowed. You should edit your answer.
Yeah, I messed that up. My bad.