local player = game.Players.LocalPlayer
local currency = player:WaitForChild('leaderstats').Points
local amount = 50
local tool = game.ServerStorage:WaitForChild('BlueKatana')
local indextext = script.Parent.Text
script.Parent.MouseButton1Click:connect(function()
if currency.Value >= amount and not player.Backpack:FindFirstChild('BlueKatana') or player.Character:FindFirstChild('BlueKatana') then
currency.Value = currency.Value - amount
local newtool = tool:Clone()
newtool.Parent = player.Backpack
else
script.Parent.Text = 'Purchase failed!'
wait(0.7)
script.Parent.Text = indextext
end
end)
script.Parent.MouseEnter:connect(function()
script.Parent.Parent.Parent.ProductImage.Image = 'rbxassetid://'..script.ImageValue.Value
script.Parent.Parent.Parent.Description.Text = script.DescValue.Value
script.Parent.Parent.Parent.ProductTitle.Text = script.TitleValue.Value
end)
script.Parent.MouseLeave:connect(function()
script.Parent.Parent.Parent.ProductImage.Image = 'rbxassetid://'
script.Parent.Parent.Parent.Description.Text = ''
script.Parent.Parent.Parent.ProductTitle.Text = ''
end)
✓ ANSWER ACCEPTED
This works in the testing server but not in the actual game? Its in localScript! Why????
1 answer
✓ Accepted answer
LocalScripts can't access ServerStorage
Your script yields indefinitely at
local tool = game.ServerStorage:WaitForChild('BlueKatana')
The solution is to either move all logic concerning this tool to the server, or to move the tool to ReplicatedStorage.
1 comment
0
That makes more sence,Thanks!
This discussion is preserved as it was. New answers, comments, and votes are closed.

16 comments
Strange
Try using a code block please it will make more sense.
Ohh sure ok
There you go!
This is weird because I reloaded the page and now it shows a script that I saw not too long ago on here from a different person is that ur script with the moves of the Pokemon?
Never mind this website is acting weird on this iPad...
Ok... xD
Do you know how to access the dev controller inside of a game? As in if you know how to check the output in game I do but I am asking you because try checking the output and tell me what error it pops up in there...
Where is the script placed?
The script is placed inside of a text button of a gui - localscript
Did it pop any errors inside of the game? In the output...
How do you check for errors? I got the output but it says random stuff
Well does the output pop up any errors it should pop up an error in the output just tell me what this 'random stuff' is.
17:50:16.018 - Content failed because HTTP 400 (HTTP/1.1 400 Input string was not in a correct format.) 17:50:16.026 - Unable to load plugin icon. 17:50:16.146 - Unable to create an Instance of type "StockSound" 17:50:16.147 - Script 'Plugin_-1.CutsceneEdit.Plugin', Line 58 - global addSound 17:50:16.147 - Script 'Plugin_-1.CutsceneEdit.Plugin', Line 65 17:50:16.147 - Stack End 17:50:31.321 - Work
Accept the below answer by clicking "Accept Answer" under eLunate's name/picture.
Done.