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

GameSerivce is not a valid member of DataModel?

Asked by 1 year ago

Hia,

I'm trying to make a Class Selector, using this tutorial: https://www.youtube.com/watch?v=t64gExqgPbM

However, I've run into some errors that I do not know how to fix.

Errors:

GameSerivce is not a valid member of DataModel "Game" - Server - Class_Giver:1

GameSerivce is not a valid member of DataModel "2022 V2 @ 10 Jan 2023 08:59" - Client - ButtonHandler:3

Scripts:

ButtonHandler:

local Background = script.Parent

local rp = game:GameSerivce("ReplicatedStorage") local Class = rp:WaitForChild("Class")

for _, button in pairs(Background:GetChildren()) do if button:IsA("ImageButton") then button.MouseButton1Click:Connect(function() Background.Visibile = false

        Class:FireServer(button.Name)
    end)

end

end

Class_Giver:

local rp = game:GameSerivce("ReplicatedStorage") local Class = rp:WaitForChild("Class")

local SS = game:GetService("ServerStorage") local Classes = SS:WaitForChild("Classes")

Class.OnServerEvent:Connect(function(Player,className) local Backpack = Player.Backpack

local selection = Classes:FindFirstChild(className)
if selection then
    local moveset = Classes:FindFirstChild(className) :Clone()
    moveset.Parent = Backpack
end

end)

How would I go about fixing this? When I load in, the buttons are clickable, but nothing goes into the player backpack, and the GUI stays visible, even after choosing a class.

Thanks in advance!

0
Code looks more accurate here: https://pastebin.com/fX2T3EJg Todosur 0 — 1y

2 answers

Log in to vote
1
Answered by 1 year ago
Edited 1 year ago

you spelled visible as "Visibile". If it is spelled that way in your code then it won't work and on the line that says

local moveset = Classes:FindFirstChild(className) :Clone()

dont put a space between FindFirstCHild(className) and :Clone. Write it like this.

local moveset = Classes:FindFirstChild(className):Clone()
0
Huh, didn't notice that. Went back and fixed it, thanks. I still get the same errors however. Todosur 0 — 1y
Ad
Log in to vote
0
Answered by 1 year ago

You wrote GameSerivce instead of GetService in ButtonHandler and Class_giver for the rp variable. Generally, it seems as if you misspelled some things in this script, which will give you errors even if you fix this mistake.

Answer this question