I want to make a system where when you click with a bloxy cola in your inventory it gives you points. I can't seem to figure it out, help!!! Also I need to make it so when you have more points, your jump height and walkspeed increases. Also I dont know how to add game passes, and i want one that gives you points. THANK YOU!
How do i make it so when i click with an item, it rewards points?
2 answers
To make the tool award points, you need to put a serverscript, a localscript and a remoteevent into the tool. Name the tool i.e. pointsRemote.
Then what we do next is set up the event handler for server event, aswell as a debounce to prevent them from spam clicking the tool.
After a successful click, we use PointsService:AwardPoints() to give the player one point.
Server script in the tool:
local remote = script.Parent.pointsRemote
local tool = script.Parent
local debounce = false
local interval = 1
remote.OnServerEvent:Connect(function(p)
if debounce then return end
debounce = true
local plr = tool:FindFirstAncestorWhichIsA("Player") or game:GetService("Players"):GetPlayerFromCharacter(tool:FindFirstAncestorWhichIsA("Model"))
if not plr then debounce = false return end
if p ~= plr then --a lil security
p:Kick("Stop firing someone else's remotes, nub exploiter")
debounce = false
return
end
game:GetService("PointsService"):AwardPoints(plr.UserId, 1)
wait(1)
debounce = false
end)
Localscript in the tool:
local remote = script.Parent.pointsRemote
local tool = script.Parent
tool.Activated:Connect(function()
remote:FireServer()
end)
Now, to make their WalkSpeed increase, let's say by 1 for each 10 points, we're going to use PointsService:GetGamePointBalance() in any server script. It would be the best to have only one server script handle it.
local ps = game:GetService("PointsService")
game:GetService("Players").PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local hum = char:WaitForChild("Humanoid")
hum.WalkSpeed = 16 + math.floor(ps:GetGamePointBalance(plr.UserId) / 10)
end)
end)
13 comments
Jesus christ
lol
how do you put a server script in the tool?
Create one under the tool in studio. Right click the tool > Insert Object > Script
im sorry for being stupid but are you talking about the bloxy cola tool?
Lovely script, please don't feed into requesters though.
Yes, im talking about the bloxy cola tool
then do we add anything into the remoteevent?
It says this : PointsService:GetUserPointBalanceInUniverse failed because PointsService:GetUserPointBalanceInUniverse failed because Non-API Proxy BaseURL used. HttpRbxApiService is only for API Proxy calls. And this : pointsRemote is not a valid member of Tool
You need to create the pointsRemote under the tool aswell. Right Click > Insert Object > RemoteEvent > rename to pointsRemote
as for the pointsservice error, it could be due to the fact that you test in studio
is a server script just a script?
@PikaPeedy yes it is
local Tool = script.Parent
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Mouse = Player:GetMouse()
Mouse.Button1Down:connect(function()
while true do
Player.leaderstats.Points.Value = Player.leaderstats.Points.Value + 100
Character.Humanoid.WalkSpeed = math.huge
-- do rest
end
end)
2 comments
MouseButton1Down isn't an event of a tool
Now it wouldn't be FE compatible, would fire even if the tool isn't equipped, and would always set the WalkSpeed to math.huge no matter how many points they have
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
It would have to be a "custom" Bloxy Cola and not directly from Roblox. Plus, SH is not a request site.
im just asking...? also if this isnt what is a good site to do that
Well a pro-tip would be; Read the rules to a forum before posting. "No requests" is plastered all over here.