This script works but I'm just showing you that I already added it
game.Players.PlayerAdded:connect(function(player)
local M = instance.new("StringValue")
M.name = "Magic"
M.Value = "Nothing"
M.Parent = player.leaderstats
But this LocalScript doesn't work unfortunately
script.Parent.MouseButton1Click:Connect:function()
S = math.random(1,25)
if S = 1 then M.Value = "Phoenix"
if S = 2 then M.Value = "Void"
if S = 3 then M.Value = "Galaxy"
if S = 4 then M.Value = "Blackhole"
if S = 5 then M.Value = "Crystal"
if S = 6 then M.Value = "Explosion"
if S = 7 then M.Value = "Wood"
if S = 8 then M.Value = "Gold"
if S = 9 then M.Value = "Star"
if S = 10 then M.Value = "Poison"
if S = 11 then M.Value = "Vortex"
if S = 12 then M.Value = "Hurricane"
if S = 13 then M.Value = "Stone"
if S = 14 then M.Value = "Time"
if S = 15 then M.Value = "Amaterasu"
if S = 16 then M.Value = "Dragon"
if S = 17 then M.Value = "Supersonic"
if S = 18 then M.Value = "Diamond"
if S = 19 then M.Value = "leviathan"
if S = 20 then M.Value = "Magma"
if S = 21 then M.Value = "Acid"
if S = 22 then M.Value = "Plasma"
if S = 23 then M.Value = "Storm"
if S = 24 then M.Value = "Sound"
if S = 25 then M.Value = "Speed"

1 comment
incorrect, M.Value is right. also, "=" isn't necessarily for variables, it's generally for assigning a value