I keep getting an error saying: Ball is not a valid member of StringValue “Players.BlueClothesPerson.leaderstats.Ball”
Things I've tried
I have tried changing leaderstat.Ball.Value = "Default"
to leaderstat.Ball.StringValue = "Default"
, and searching on the dev forums for any-one who had any similar problems.
Script(s)
Button to give the ball
local Case = script.Parent.Parent
local ClickDetector = script.Parent
local Ball = game.ServerStorage.Default --> Change Default to ball name.. <--
local ClickSound = game.ReplicatedStorage.GloveGot
-- Actual Script
ClickDetector.MouseClick:Connect(function(plr)
local leaderstat = plr.leaderstats.Ball
ClickSound:Play()
leaderstat.Ball.Value = "Default"
end)
Leaderstats/Leaderboard
local Players = game:GetService("Players")
local INTvalue = Instance.new("IntValue")
local function leaderboardSetup(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local Punches = Instance.new("IntValue")
Punches.Name = "Smacks"
Punches.Value = 0
Punches.Parent = leaderstats
local Ball = Instance.new("StringValue")
Ball.Name = "Ball"
Ball.Value = "Default"
Ball.Parent = leaderstats
end
Players.PlayerAdded:Connect(leaderboardSetup)
Any help is appreciated