#buy weapon by touching it
38 messages · Page 1 of 1 (latest)
Did you write this in a local script?
^?
Also, which errors are you getting?
I have this set up but when I interact nothing happens
and this script
what i can do
i have the gun (usp) in ServerStorage

** You are now Level 1! **
@unborn orchid
do you still need help?
aigh instead of the local script insert a serverscript inside of the proximinity promt like this
and here is the script
local toolName = "USP" -- Cambia esto por el nombre del modelo del arma en ReplicatedStorage
local price = 100 -- Precio del arma
local ReplicatedStorage = game:GetService("ReplicatedStorage")
script.Parent.Triggered:Connect(function(Player)
-- Verificar si el jugador tiene suficiente dinero
if Player.leaderstats.Coins.Value >= price then
-- Quitar el dinero
Player.leaderstats.Coins.Value = Player.leaderstats.Coins.Value - price
-- Dar el arma al jugador
local weapon = ReplicatedStorage:FindFirstChild(toolName)
if weapon then
local weaponClone = weapon:Clone()
weaponClone.Parent = Player.Backpack
else
warn("No se encontró el arma en ReplicatedStorage.")
end
else
print("No tienes suficiente dinero.")
end
end)
could somebody help me? https://discord.com/channels/448986884497211392/1286438747759579220 the last guy was quite unhelpful.
no bro
nothing
;c
I interact and nothing happens
did you switch the local script with a serverscript?
wait, replace my script with the one you sent me, did I do wrong?
and I left all this in workspace
replace your code with the code i sent you
and
then it should work
** You are now Level 2! **
then something must be wrong with the other stuff i just showed you how to detect the E pressed
did you get any errors?
I tried it, but it didn't work for me. but thank you anyway!