you’re supposed to delete the .value in the brackets, not the .value outside. because you are trying to waitforchild for the stringvalue, with the .value to mention the value property of said stringvalue
but when i delete the value in the brackets, the script doesent run at all
then its probably an issue with the remainder of your script.
the localscript should works, i know because the bought massage i put is printed, so is the problem in the serverscript?
Try printing all the variables in the serverscript to see what isn’t working.
it doesent print anything in all of the variables
Can you show me the code where you printed the variables?
does CurrentShown have anything in the Value?
local price = script.Parent.Parent.Parent.CPrice
local chosen = script.Parent.Parent.Parent.CurrentShown
game.ReplicatedStorage.BuyEvents.BoughtWCoins.OnServerEvent:Connect(function(player)
local folder = player:WaitForChild("SwordStatus")
local sword = folder:WaitForChild(tostring(chosen.Value))
local coins = player.Coins
print(price)
print(chosen)
print(folder)
print(sword)
print(coins)
coins.Value -= price.Value
sword = true
end)
wht do you mean? i didnt understand your question.
is the Value
property of the Instance CurrentShown
(or as seen in the script)
defined? because if CurrentShown.Value
is blank, then tostring(chosen.Value)
(or as shown in the script)
will return a blank text and it will wait for a child named “” which doesn’t exist and will wait forever, as seen in the console
Thats the thing i wondered, it worked on the localscript, put doesent in the serverscript
what script is CurrentShown.Value
being changed at? if you changed anything from the server, it will replicate to all clients but changing in the client doesn’t replicate to the server and other clients without using RemoteEvent
s
it’s best you check this out
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.