So, I am making a item system and for some reason (even when I print something before it does anything) it doesn’t work!
Here’s the script location:
Here is the beginning of the script:
game.ReplicatedStorage.WeldRemotes["Mud Walkers Server"].OnServerEvent:Connect(function(player,item)
print("welding")
Edit: I also make made sure that the server event is firing!
Valkyrop
(JustAGuy)
August 27, 2022, 10:40pm
#2
Mind showing the client side of the remote?
3 Likes
weldremotes["Mud Walkers Client"].OnClientEvent:Connect(function(player,item)
print(item)
local remote = weldremotes["Mud Walkers Server"]
if remote then
print("sendinng")
remote:FireServer(player,item)
print("sent")
end
end)
Valkyrop
(JustAGuy)
August 27, 2022, 10:43pm
#4
I see. You dont need to provide player as first argument in the FireServer. It automatically does that for you.
If that player is still needed, then on the server call, you would need to have 3 arguments.
It still doesn’t work. I think it has something to do with the other script
Kaid3n22
(Kaiden)
August 27, 2022, 10:45pm
#6
The script doesn’t run because it is in ServerStorage.
Where should I put it? Because the script NEEDS to be in the location its in. Since its welding and changing locations of the shoes.
Kaid3n22
(Kaiden)
August 27, 2022, 10:47pm
#8
It doesn’t necessarily NEED to be in the shoes.
local shoes = game.ServerStorage.Items.Clothing.Boots.MudWalkers
game.ReplicatedStorage.WeldRemotes["Mud Walkers Server"].OnServerEvent:Connect(function(player,item)
print("welding")
end)
Put the script inside of ServerScriptService.
I have already tried this it comes out as errors, and I looked into it because the vector3 position can only be changed when its in the same parent (or in the part) as the parts its trying to move
Kaid3n22
(Kaiden)
August 27, 2022, 10:49pm
#10
Change the references of script.Parent
to shoes
but since its not in server storage it wont work, right?
also heres the welding:
local character = player.Character
local leftleg = character["Left Leg"]
local rightleg = character["Right Leg"]
local boots = script.Parent:Clone()
local weld1 = Instance.new("Weld")
local weld2 = Instance.new("Weld")
weld1.Parent = boots.LeftShoe
weld2.Parent = boots.RightShoe
local leftshoe = boots.LeftShoe
local rightshoe = boots.RightShoe
boots.Parent = character
leftleg.Position = leftleg.Position
rightshoe.Position = rightleg.Position
rightshoe.Orientation = rightleg.Orientation
leftshoe.Orientation = leftshoe.Orientation
rightleg.Anchored = true
leftleg.Anchored = true
rightshoe.Anchored = true
leftshoe.Anchored = true
weld1.Part0 = leftshoe
weld1.Part1 = leftleg
weld2.Part0 = rightshoe
weld2.Part1 = rightleg
rightleg.Anchored = false
leftleg.Anchored = false
Kaid3n22
(Kaiden)
August 27, 2022, 10:50pm
#12
local boots = shoes:Clone()
that should fix it.
if i put this in the script thats in serverscriptservice it should work?
Kaid3n22
(Kaiden)
August 27, 2022, 10:52pm
#14
Yes. Assuming you added the shoes
variable at the beginning and changed boots to what I said, it should work perfectly fine.
It’s not finding the boots
here is the script:
for i,v in pairs (items) do
if i == item then
print("found: ".. item)
if v.itemtype == "boots" then
print("indeed boots")
local shoes = game.ServerStorage.Items.Clothing.Boots:WaitForChild(i)
Kaid3n22
(Kaiden)
August 27, 2022, 11:08pm
#16
What is itemtype
? Does it print “indeed boots?” It would also help if I could see more of the script.
It’s in the table:
local items = {
["Mud Walkers"] = {
itemtype = "boots",
location = itemsfolder.Clothing.Boots.MudWalkers,
amount = Instance.new("NumberValue").Name == "amount",
rarity = 3 -- 1 out of 10
},
Kaid3n22
(Kaiden)
August 27, 2022, 11:21pm
#18
The problem is that the name has a space inside of it. But, you can simply do this:
for i,v in pairs (items) do
if i == item then
print("found: ".. item)
if v.itemtype == "boots" then
print("indeed boots")
local shoes = v.location
1 Like
Thank you VERY much!!! This helps soooo much!
Kaid3n22
(Kaiden)
August 27, 2022, 11:23pm
#20
Welcome glad I could help you