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

SeverStorage is named Severstorage but it's saying its not vaild, how would I fix this?

Firstly:

script.Parent.MouseButton1Click:Connect(function()
	
	script.Parent.Parent.Parent.Parent.Sound:Play()
	if script.Parent.Parent.Purchased.Value == true then
		-- Spawn it
		game.ReplicatedStorage.SpawnCar:FireServer(script.Parent.Parent.Name)
	else
		-- Let them purchase it	
		local PriceOfItem = game.ReplicatedStorage:WaitForChild("CheckPrice"):InvokeServer(script.Parent.Parent.Name)
		
		if game.Players.LocalPlayer.leaderstats.Cash.Value >= PriceOfItem and script.Parent.Parent.Purchased.Value == false then
			-- The player has enough cash
			game.Players.LocalPlayer.leaderstats.Cash.Value = game.Players.LocalPlayer.leaderstats.Cash.Value - PriceOfItem
			script.Parent.Parent.Purchased.Value = true
			script.Parent.Text = "Spawn"
			script.Parent.MouseButton1Click:Connect(function()
				script.Parent.Parent.Parent.Visible = false
				script.Parent.Parent.Parent.Parent.Open.Text = "Spawn A Bus"
			end)
		end
	end
end)

The output error is: SeverStorage is not a valid member of DataModel, that error happens at line 9:

local PriceOfItem = game.ReplicatedStorage:WaitForChild("CheckPrice"):InvokeServer(script.Parent.Parent.Name)

Alright, I just searched up 'what is datamodel on roblox' datamodel is just a fancy way to say "game." Before you say it, yes SeverStorage is named SeverStorage on this place, buts its still not cooperating. Thanks!

2 answers

✓ Accepted answer

Try renaming SeverStorage to Serverstorage and then back again.

1 comment

0

If this does not work try renaming SeverStorage to just Serverstorage

Hmmmm, I'm an idiot, the name was "Sever Storage" not ServerStorage. OH GOD THIS QUARANTINE IS DRIVING ME CRAZZZZZYYYY

1 comment

0

Lol

This discussion is preserved as it was. New answers, comments, and votes are closed.