I'm very confused. I'm trying to make it so that if you hold E with Roblox's "ProximityPrompt", you will get a GUI on your screen with some text. Everything works except that the text won't work. I also am not writing a string on the client script. There is a variable for it on the server script that gets passed over. But I keep seeing this error in the output.
Players.ford200000.PlayerGui.BuyGui.Frame.TextInput.Text:2: attempt to concatenate nil with string - Client -
Here is what I'm doing in my script
local sp = script.Parent
sp.ProximityPrompt.Triggered:Connect(function(player)
local name = sp.Name
local ss = game.ServerStorage
local item = ss.Hats:FindFirstChild(name)
local price = item.Price
game.ReplicatedStorage.ShopClickEvent:FireClient(player)
game.ReplicatedStorage.ShopInfoEvent:FireClient(player)
end)
And in the local script that listens for ShopInfoEvent
game.ReplicatedStorage.ShopInfoEvent.OnClientEvent:Connect(function(player, price, item)
script.Parent.Text = "Would you like to buy this ".. item.Name .." for ".. price.Value .."?"
end)
Please help, that would be greatly appreciated.
local sp = script.Parent sp.ProximityPrompt.Triggered:Connect(function(player) local name = sp.Name local ss = game.ServerStorage local item = ss.Hats:FindFirstChild(name) local price = item.Price game.ReplicatedStorage.ShopClickEvent:FireClient(player) game.ReplicatedStorage.ShopInfoEvent:FireClient(player) end)
Server script – ford200000game.ReplicatedStorage.ShopInfoEvent.OnClientEvent:Connect(function(player, price, item) script.Parent.Text = "Would you like to buy this ".. item.Name .." for ".. price.Value .."?" end)
Client script – ford200000