Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years ago

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

Log in to vote
0
Answered by
iVmk3 -143
4 years ago

Try renaming SeverStorage to Serverstorage and then back again.

0
If this does not work try renaming SeverStorage to just Serverstorage iVmk3 -143 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

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

0
Lol iVmk3 -143 — 4y

Answer this question