hello👋
i have issues with roblox studio..
when player buy npc
his money be -100
the localscript
the normal script
thank you for read
hello👋
i have issues with roblox studio..
when player buy npc
his money be -100
the localscript
the normal script
thank you for read
Are there any errors? Also, you should check how much money the player has on the normal script too.
local Player = game:GetService("Players").LocalPlayer
local npcevent1 = game:GetService("ReplicatedStorage"):WaitForChild("npcevent1")
local npcnotwork = game:GetService("ReplicatedStorage"):WaitForChild("npcnotwork")
local leaderstats = Player:WaitForChild("leaderstats")
script.Parent.MouseButton1Down:Connect(function()
if leaderstats.lod.coins.Value >= 125 and Player.lod.npc.Value == false then
cost.Text = "cost:300"
npcnumber.Text = "1 npc"
ownnpc.Text = "your own npc is 1"
npcevent1:FireServer()
npcnotwork:FireServer()
end
end)
local npcevent1 = game:GetService("ReplicatedStorage"):WaitForChild("npcevent1")
npcevent.OnServerEvent:Connect(function(plr)
local leaderstats = plr:WaitForChild("leaderstats")
leaderstats.lod.npc1.Value = true
leaderstats.lod.npc.Value = 1
leaderstats.lod.npc2.Value = false
leaderstats.lod.coins.Value = leaderstats.lod.coins.Value - 100
end)
You just have to check if the player has enough money to buy things in the normal script!
Else, don’t say it’s an issue with roblox studio because YOU made mistake, not roblox studio, plus a pc never get the wrong answer!
Have a good day !
The code its ok, add the same verifs if you have on localscript to serverscript
there no errors and money system is so good
i copy and paste it on another place and its work
i think its from studio
thank you for reply
its coins
when player buy npc
the player lose 1000 + 10
i dont know why player lose 1000
thank for any one reply
i fix it
should for any one think Out of the box
This script may not be the problem.