Caution: Fraudulent or imitation websites may appear. Only this site is official. Report concerns on our Report Fraud page.
CloudScript is PlayFab’s server‑side scripting system.
It allows your game to run secure logic on PlayFab’s servers instead of the client, protecting your economy, inventory, moderation tools, and progression systems from cheating.
CloudScript is essential for any VR fangame that uses:
Virtual Currency
Inventory (cosmetics)
Shops
Moderation
Player progression
Event rewards
Photon authentication
This page explains how CloudScript works, why it’s required, and how it fits into your game’s backend.
1. What CloudScript Is
CloudScript is JavaScript code that runs on PlayFab’s servers.
Your game calls CloudScript functions to perform secure operations.
CloudScript can:
Grant items
Add or subtract currency
Validate purchases
Ban/unban players
Update stats
Log events
Run shop logic
Handle daily rewards
Validate Photon authentication
Anything that should NOT be trusted to the client belongs in CloudScript.
2. Why VR Fangames Need CloudScript
VR games are extremely easy to mod or exploit.
If you run important logic on the client, players can:
Give themselves unlimited currency
Unlock all cosmetics
Fake event rewards
Modify stats
Bypass shop prices
Grant themselves staff items
Remove bans
CloudScript prevents all of this by running logic on the server.
3. How CloudScript Works (Flow)
Step 1 — Game sends a request
Your Unity client calls a CloudScript function (e.g., BuyItem, GrantReward, AddCurrency).
Step 2 — CloudScript validates
The server checks:
Does the player have enough currency
Is the item real
Is the request allowed
Is the player banned
Is the staff action authorized
Step 3 — CloudScript performs the action
Examples:
Subtract currency
Grant item
Add XP
Log the action
Update stats
Step 4 — CloudScript returns a result
The game receives:
Success/failure
Updated inventory
Updated currency
Error messages
4. Common Uses in VR Fangames
A. Shop Purchases
Validate currency
Subtract cost
Grant cosmetic
Log purchase
B. Event Rewards
Check if the player qualifies
Grant event items
Add event currency
C. Moderation
Ban/unban players
Add moderation flags
Log staff actions
D. Player Progression
Level‑up rewards
Daily login bonuses
XP systems
E. Secure Currency Operations
Add currency
Subtract currency
Prevent client‑side cheating
F. Photon Authentication
Validate player identity
Sync stats
Prevent spoofed Photon logins
5. CloudScript Best Practices
Never trust the client
Validate all inputs
Log important actions
Keep scripts small and modular
Use Title Data for config values
Use CloudScript for all economy operations
Do not expose sensitive logic to the client
Use consistent naming for functions
6. CloudScript + Inventory System
CloudScript is required for:
Granting items
Consuming items
Shop purchases
Event rewards
Staff item grants
This ensures your inventory cannot be hacked.
7. CloudScript + Virtual Currency
CloudScript handles:
Adding currency
Subtracting currency
Validating balances
Preventing fake currency adds
This protects your economy.
8. CloudScript + Moderation
CloudScript can:
Ban players
Unban players
Add moderation notes
Log staff actions
Validate staff permissions
This keeps your moderation tools secure.