#my script for a sword doesnt work?

1 messages · Page 1 of 1 (latest)

cursive imp
#

so ive been making a shop for my game and every thing has been good except for one thing, when ever i try to sell a sword it wont take the players money, and doesnt equip it

dull depot
leaden swallow
cursive imp
waxen tundraBOT
#

studio** You are now Level 3! **studio

cursive imp
cursive imp
cursive imp
dull depot
leaden swallow
#

DON'T LEAVE ME HERE

dull depot
#

im cheering for you from the backcoolguy

leaden swallow
dull depot
leaden swallow
cursive imp
#

can i know why and how

dull depot
#

this was more of a question

#

this handles taking away the money + equipping the sword

cursive imp
#

cause your buying it

dull depot
#

but does that work

cursive imp
#

no

dull depot
#

alr

#

add these before each if statement
print(findinfo), print(price), print(tool)

cursive imp
#

where do i add that?

dull depot
#

before checking the variables with the if statement

leaden swallow
dull depot
leaden swallow
#

ohk

dull depot
leaden swallow
#

suffer >:3

cursive imp
#

like this

#

?

dull depot
leaden swallow
cursive imp
#

what

#

i lowk had to watch a tut

dull depot
#
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PurchaseEvent = ReplicatedStorage:WaitForChild("PurchaseEvent")
local Weapons = ReplicatedStorage:WaitForChild("Weapons")

PurchaseEvent.OnServerEvent:Connect(function(player, weaponname)
    local findinfo = Weapons:FindFirstChild(weaponname)
    
    print("findinfo:", findinfo)
    if findinfo then
        local price = findinfo:FindFirstChild("Price")
        local tool = findinfo:FindFirstChildWhichIsA("Tool")
        
        print("price:", price, " | tool:", tool)
        if price and tool then
            if player.leaderstats.Cash.Value >= price.Value then
                player.leaderstats.Cash.Value = player.leaderstats.Cash.Value - price.Value
                
                local clonedtool = tool:Clone()
                clonedtool.Parent = player.Backpack
            end
        end
    end
end)
#

like this

leaden swallow
dull depot
cursive imp
#

now the gui wont open

dull depot
leaden swallow
dull depot
dull depot
#

windows server as a domain controller

dull depot
#

im 100% sure

#

we added 3 prints

#
  • this script isn't even for the gui
cursive imp
dull depot
#
  • ur doing ui on the server
dull depot
cursive imp
#

wrong one mb

dull depot
#

Ctrl + A, Delete

Ctrl + C on the script i sent

Ctrl + V

cursive imp
dull depot
#

now run

cursive imp
#

still wont open

dull depot
#

AND OPEN THE CONSOLE

cursive imp
#

ok

#

now what

leaden swallow
cursive imp
#

i am?

dull depot
#

omg

#

YES YOU ARE

#

SPAM CTRL + Z

cursive imp
#

ok

leaden swallow
cursive imp
#

ohhh

#

damn mb

#

still wont work

dull depot
#

we need you to get all those braincells working at once now

go to the left top in roblox studio

press window and then console

cursive imp
leaden swallow
#

output*

dull depot
#

output

#

yes

cursive imp
#

ok now what

dull depot
#

playtest and show us the outputsippiee

cursive imp
#

like record?

dull depot
#

no

#

a screenshot is enough

cursive imp
#

ok

#

i clicked twice

dull depot
#

price is nil

#

thats ur problem right there

cursive imp
#

whats nil

dull depot
#

non existent

cursive imp
#

but its right there

dull depot
#

show me the explorer

cursive imp
#

is that the right

dull depot
#

yes

cursive imp
#

ok

dull depot
#

open this and show me the sword

cursive imp
dull depot
#

thats why it can't find it

cursive imp
#

one sec

waxen tundraBOT
#

studio** You are now Level 4! **studio

dull depot
#

for you i'll even wait 2

cursive imp
#

so make it big?

dull depot
#

yes

cursive imp
#

do i click it

dull depot
#

right click rename

cursive imp
#

got it

dull depot
#

its so over

cursive imp
#

ey

#

it works

#

thanks brotato

dull depot
#

no problem

cursive imp
#

one more thing

#

jk

leaden swallow
#

trying to help a newbie in scripting is just like teaching a toddler to drive

cursive imp
#

thanks

dull depot
#

and he didnt learn shit just like the toddlerwhoknows

leaden swallow
dull depot
leaden swallow
dull depot
#

no