generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: FE Script Not Working

Previous Thread :: Next Thread 
KingKamII is online. KingKamII
Joined: 21 Oct 2016
Total Posts: 471
05 Aug 2017 04:52 PM
Okay. So this script works in Solo Mode but not in an actual server. Nothing shows up in output either. All the variables are correct. Can somebody tell me what is wrong?

--Local Script-- In a button in a frame in a frame in a gui in PlayerGui. Lol
local BuyButton = script.Parent

local function onMouseClick()
local plr = game.Players.LocalPlayer
local Sword = script.Parent.Parent.Config.SwordName.Value
local Cost = script.Parent.Parent.Config.Cost
local BuyEvent = game.ReplicatedStorage.RemoteEvents.Buy
BuyEvent:FireServer(Sword,Cost)
end

BuyButton.MouseButton1Down:Connect(onMouseClick)

--Server Script-- In ServerScriptService
--Variables
local BuyEvent = game.ReplicatedStorage.RemoteEvents.Buy

--Functions
BuyEvent.OnServerEvent:Connect(function(plr,Sword,Cost)
local Weapon = game.ReplicatedStorage.Weapons.Swords:FindFirstChild(Sword)
local Gold = plr.Data.Gold
if Gold.Value >= Cost.Value then
Gold.Value = Gold.Value - Cost.Value
local WeaponClone = Weapon:Clone()
WeaponClone.Parent = plr.Backpack
else
print("Nope")
end
end)


A wise man once told me that life is a mirror...
Report Abuse
KingKamII is online. KingKamII
Joined: 21 Oct 2016
Total Posts: 471
05 Aug 2017 04:58 PM
B1


A wise man once told me that life is a mirror...
Report Abuse
Laedere is online. Laedere
Joined: 17 Jun 2013
Total Posts: 23601
05 Aug 2017 04:58 PM
I suggest you don't fire the cost locally, an exploiter can basically fire that RemoteEvent and get any sword he wants for free. If I were you, I would only fire the Sword argument then check the player's money on the server.


Report Abuse
KingKamII is online. KingKamII
Joined: 21 Oct 2016
Total Posts: 471
05 Aug 2017 05:04 PM
I don't see what you mean... What should I change


A wise man once told me that life is a mirror...
Report Abuse
KingKamII is online. KingKamII
Joined: 21 Oct 2016
Total Posts: 471
05 Aug 2017 05:06 PM
I still don't see how it doesn't work in a server.


A wise man once told me that life is a mirror...
Report Abuse
Laedere is online. Laedere
Joined: 17 Jun 2013
Total Posts: 23601
05 Aug 2017 05:09 PM
Fix your script first.


Report Abuse
KingKamII is online. KingKamII
Joined: 21 Oct 2016
Total Posts: 471
05 Aug 2017 05:10 PM
But do you see why this one is working in Solo but not in a server?


A wise man once told me that life is a mirror...
Report Abuse
KingKamII is online. KingKamII
Joined: 21 Oct 2016
Total Posts: 471
05 Aug 2017 05:16 PM
B2


A wise man once told me that life is a mirror...
Report Abuse
Laedere is online. Laedere
Joined: 17 Jun 2013
Total Posts: 23601
05 Aug 2017 05:17 PM
Are you sure that you script that listens for the RemoteEvent is a regular Script and not a LocalScript?


Report Abuse
KingKamII is online. KingKamII
Joined: 21 Oct 2016
Total Posts: 471
05 Aug 2017 05:22 PM
100% sure


A wise man once told me that life is a mirror...
Report Abuse
KingKamII is online. KingKamII
Joined: 21 Oct 2016
Total Posts: 471
05 Aug 2017 05:26 PM
So any ideas?


A wise man once told me that life is a mirror...
Report Abuse
KingKamII is online. KingKamII
Joined: 21 Oct 2016
Total Posts: 471
05 Aug 2017 05:29 PM
PLZ


A wise man once told me that life is a mirror...
Report Abuse
KingKamII is online. KingKamII
Joined: 21 Oct 2016
Total Posts: 471
05 Aug 2017 05:39 PM
B2


A wise man once told me that life is a mirror...
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image