Hia,
I'm trying to make a Class Selector, using this tutorial:
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
ServerScriptService > script "Class_Giver"
StarterGui > HUD > Background > local script "ButtonHandler"
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!
I'm trying to make a Class Selector, using this tutorial:
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
ServerScriptService > script "Class_Giver"
Code:
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)
Code:
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
Thanks in advance!