#Can anyone help me make a small script where if a player selects a dialog choice it removes 10 click
1 messages · Page 1 of 1 (latest)
^ show me script / video please
serverscriptservice script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- make sure a RemoteEvent exists
local remote = Instance.new("RemoteEvent")
remote.Name = "DialogRemote"
remote.Parent = ReplicatedStorage
-- when fired, remove 10 clicks
remote.OnServerEvent:Connect(function(player)
local stats = player:FindFirstChild("Leaderstats")
if stats then
local clicks = stats:FindFirstChild("Clicks")
if clicks then
clicks.Value = math.max(0, clicks.Value - 10)
end
end
end)
starterplayerscripts script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local remote = ReplicatedStorage:WaitForChild("DialogRemote")
-- connect to all Dialogs
for _, dialog in ipairs(workspace:GetDescendants()) do
if dialog:IsA("Dialog") then
dialog.DialogChoiceSelected:Connect(function(p, choice)
if p == player and choice.Name == "Yes please" then
remote:FireServer()
end
end)
end
end
literally only need it to take 10 Clicks from the player when he selects the dialogue option.
No. sadly im an ltn😔
but can YOU help?
Okay
Okay
chatgpt stupid or you
both
** You are now Level 3! **
🙏🏻
Yes
ok
i mean i am not seeing if its not working, can you make it run for a sec
and try doing the option
sure
sometimes its a stupid mistake, so if i cant understand the issue with it running i will make you put a debug print
Holy freemodel
We?
friends
me and a friend
Ok
🤔
tbh, i have never used the dialog system in my life, where is this "choice" saved at?
idk
No fucking way
the problem was
Leaderstats was misspeled. It was actually just leaderstats
damn
thanks for the help everyone
.
"stupid mistake
it didnt i think
always miss them ;p
Print("works")
and i havent used leaderstats in like 6 years
damn
are you purely saving to leaderstats or do you have a datastore setup?
i mean when i rejoin i still have the stuff saved. Paid a scripter to do stuff for my game
okay but if your saving the leaderstats in server then if they change the value to 1,000,00
it saves and ez abusing your game
you want to change their data in the data store
then update the leaderstats using that value
client reads from server not the other way 🙏
Today we look at a new library for easily saving player data inside of Roblox! The Profile Store library is created by the same developer of the Profile Service library, which we've used for saving our player data for so long.
Subscribe for more Roblox development tutorials!
Profile Store Dev Forum post:
https://devforum.roblox.com/t/profilesto...
this will change your life
ty
also @keen trout Would this tutorial work for player models?>https://www.youtube.com/watch?v=87BgDTAqvjg
Today we create the Pet Follow system in our Simulator on Roblox!
Subscribe for more Roblox Scripting Tutorials!
Free Model Assets can be obtained from my Patreon here:
https://www.patreon.com/posts/74404136
Free Pet Models:
https://devforum.roblox.com/t/free-pet-pack-28-pets/958670
Join my Patreon to support me and gain access to the Script...
yeah likely
i havent watched it but i would assume so
well uhm he already had a pet sys set up

LOL
i would highly suggest learning content yourself
rather than going right in
it's ok to not know something
he left