Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

This works in the testing server but not in the actual game? Its in localScript! Why????

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)

16 comments

0

Strange

0

Try using a code block please it will make more sense.

0

Ohh sure ok

0

There you go!

0

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?

0

Never mind this website is acting weird on this iPad...

0

Ok... xD

0

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...

0

Where is the script placed?

0

The script is placed inside of a text button of a gui - localscript

0

Did it pop any errors inside of the game? In the output...

0

How do you check for errors? I got the output but it says random stuff

0

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.

0

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

0

Accept the below answer by clicking "Accept Answer" under eLunate's name/picture.

0

Done.

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.